The response has been limited to 50k tokens of the smallest files in the repo. You can remove this limitation by removing the max tokens filter.
├── LICENSE
├── cocos
    └── kr2
    │   ├── .cocos-project.json
    │   ├── Resources
    │       └── res
    │       │   └── locale
    │       │       ├── en_us.xml
    │       │       ├── ja_jp.xml
    │       │       ├── zh_cn.xml
    │       │       └── zh_tw.xml
    │   ├── cocosstudio
    │       ├── img
    │       │   ├── Cancel_Normal.png
    │       │   ├── Cancel_Press.png
    │       │   ├── CheckBoxNode_Normal.png
    │       │   ├── CheckBoxNode_Press.png
    │       │   ├── CheckBox_Disable.png
    │       │   ├── CheckBox_Normal.png
    │       │   ├── CheckBox_Press.png
    │       │   ├── about_icon.png
    │       │   ├── back_btn_off.png
    │       │   ├── back_btn_on.png
    │       │   ├── back_icon.png
    │       │   ├── circle_arrow.png
    │       │   ├── circle_arrow_normal.png
    │       │   ├── circle_arrow_press.png
    │       │   ├── circle_white.png
    │       │   ├── empty.png
    │       │   ├── exit_icon.png
    │       │   ├── gray.png
    │       │   ├── keyboard_icon.png
    │       │   ├── menu_handler.png
    │       │   ├── menu_icon.png
    │       │   ├── menu_press.png
    │       │   ├── mouse_2btn.png
    │       │   ├── mouse_icon.png
    │       │   ├── mouse_left_btn.png
    │       │   ├── mouse_right_btn.png
    │       │   ├── right_triangle.png
    │       │   ├── syssetting_btn_ff.png
    │       │   ├── syssetting_btn_on.png
    │       │   ├── touch1.png
    │       │   ├── touch2.png
    │       │   ├── touch_icon.png
    │       │   ├── triangle.png
    │       │   ├── white.png
    │       │   └── windows_icon.png
    │       ├── mouse_2btn.png
    │       ├── mouse_left_btn.png
    │       ├── mouse_right_btn.png
    │       └── ui
    │       │   ├── BottomBar.csd
    │       │   ├── BottomBarTextInput.csd
    │       │   ├── CheckListDialog.csd
    │       │   ├── FileItem.csd
    │       │   ├── FileManageMenu.csd
    │       │   ├── GameMenu.csd
    │       │   ├── KeySelect.csd
    │       │   ├── ListItem.csd
    │       │   ├── ListView.csd
    │       │   ├── MainFileSelector.csd
    │       │   ├── MediaPlayerBody.csd
    │       │   ├── MediaPlayerFoot.csd
    │       │   ├── MediaPlayerNavi.csd
    │       │   ├── MenuList.csd
    │       │   ├── MessageBox.csd
    │       │   ├── NaviBar.csd
    │       │   ├── NaviBarWithMenu.csd
    │       │   ├── ProgressBox.csd
    │       │   ├── RecentListItem.csd
    │       │   ├── SelectList.csd
    │       │   ├── SelectListItem.csd
    │       │   ├── TableView.csd
    │       │   ├── TextPairInput.csd
    │       │   ├── WinMgrOverlay.csd
    │       │   ├── comctrl
    │       │       ├── CheckBoxItem.csd
    │       │       ├── SelectListItem.csd
    │       │       ├── SeperateItem.csd
    │       │       ├── SliderIconItem.csd
    │       │       ├── SliderTextItem.csd
    │       │       └── SubDirItem.csd
    │       │   └── help
    │       │       ├── AllTips.csd
    │       │       ├── MouseModeTips.csd
    │       │       ├── ScreenModeTips.csd
    │       │       └── TouchModeTips.csd
    │   ├── kr2.ccs
    │   └── kr2.cfg
├── privacy_policy.txt
├── project
    └── android
    │   ├── AndroidManifest.xml
    │   ├── jni
    │       ├── Android.mk
    │       ├── Application.mk
    │       └── src
    │       │   └── SDL_android_main.cpp
    │   ├── project.properties
    │   └── src
    │       └── org
    │           └── tvp
    │               └── kirikiri2
    │                   ├── KR2Activity.java
    │                   ├── Kirikiroid2.java
    │                   └── MediaStoreHack.java
├── readme.md
└── src
    ├── core
        ├── Android.mk
        ├── base
        │   ├── 7zArchive.cpp
        │   ├── BinaryStream.cpp
        │   ├── BinaryStream.h
        │   ├── CharacterSet.cpp
        │   ├── CharacterSet.h
        │   ├── EventIntf.cpp
        │   ├── EventIntf.h
        │   ├── PluginIntf.cpp
        │   ├── PluginIntf.h
        │   ├── ScriptMgnIntf.cpp
        │   ├── ScriptMgnIntf.h
        │   ├── StorageIntf.cpp
        │   ├── StorageIntf.h
        │   ├── SysInitIntf.cpp
        │   ├── SysInitIntf.h
        │   ├── SystemIntf.cpp
        │   ├── SystemIntf.h
        │   ├── TARArchive.cpp
        │   ├── TextStream.cpp
        │   ├── TextStream.h
        │   ├── UserEvent.h
        │   ├── UtilStreams.cpp
        │   ├── UtilStreams.h
        │   ├── XP3Archive.cpp
        │   ├── XP3Archive.h
        │   ├── ZIPArchive.cpp
        │   ├── common.h
        │   ├── tar.h
        │   └── win32
        │   │   ├── EventImpl.cpp
        │   │   ├── EventImpl.h
        │   │   ├── FileSelector.cpp
        │   │   ├── FileSelector.h
        │   │   ├── FuncStubs.cpp
        │   │   ├── FuncStubs.h
        │   │   ├── NativeEventQueue.cpp
        │   │   ├── NativeEventQueue.h
        │   │   ├── PluginImpl.cpp
        │   │   ├── PluginImpl.h
        │   │   ├── ScriptMgnImpl.cpp
        │   │   ├── ScriptMgnImpl.h
        │   │   ├── StorageImpl.cpp
        │   │   ├── StorageImpl.h
        │   │   ├── SusieArchive.cpp
        │   │   ├── SusieArchive.h
        │   │   ├── SysInitImpl.cpp
        │   │   ├── SysInitImpl.h
        │   │   ├── SystemImpl.cpp
        │   │   ├── SystemImpl.h
        │   │   └── win32io.h
        ├── environ
        │   ├── Application.cpp
        │   ├── Application.h
        │   ├── ConfigManager
        │   │   ├── GlobalConfigManager.cpp
        │   │   ├── GlobalConfigManager.h
        │   │   ├── IndividualConfigManager.cpp
        │   │   ├── IndividualConfigManager.h
        │   │   ├── LocaleConfigManager.cpp
        │   │   └── LocaleConfigManager.h
        │   ├── DetectCPU.cpp
        │   ├── DetectCPU.h
        │   ├── DumpSend.cpp
        │   ├── Platform.h
        │   ├── XP3ArchiveRepack.cpp
        │   ├── XP3ArchiveRepack.h
        │   ├── android
        │   │   ├── AndroidUtils.cpp
        │   │   └── AndroidUtils.h
        │   ├── cocos2d
        │   │   ├── AppDelegate.cpp
        │   │   ├── AppDelegate.h
        │   │   ├── CCKeyCodeConv.cpp
        │   │   ├── CCKeyCodeConv.h
        │   │   ├── CustomFileUtils.cpp
        │   │   ├── CustomFileUtils.h
        │   │   ├── CustomFileUtils.mm
        │   │   ├── MainScene.cpp
        │   │   ├── MainScene.h
        │   │   ├── YUVSprite.cpp
        │   │   └── YUVSprite.h
        │   ├── combase.h
        │   ├── cpu_types.h
        │   ├── linux
        │   │   └── Platform.cpp
        │   ├── sdl
        │   │   └── tvpsdl.cpp
        │   ├── typedefine.h
        │   ├── ui
        │   │   ├── BaseForm.cpp
        │   │   ├── BaseForm.h
        │   │   ├── ConsoleWindow.cpp
        │   │   ├── ConsoleWindow.h
        │   │   ├── DebugViewLayerForm.cpp
        │   │   ├── DebugViewLayerForm.h
        │   │   ├── FileSelectorForm.cpp
        │   │   ├── FileSelectorForm.h
        │   │   ├── GameMainMenu.cpp
        │   │   ├── GameMainMenu.h
        │   │   ├── GlobalPreferenceForm.cpp
        │   │   ├── GlobalPreferenceForm.h
        │   │   ├── InGameMenuForm.cpp
        │   │   ├── InGameMenuForm.h
        │   │   ├── IndividualPreferenceForm.cpp
        │   │   ├── IndividualPreferenceForm.h
        │   │   ├── MainFileSelectorForm.cpp
        │   │   ├── MainFileSelectorForm.h
        │   │   ├── MessageBox.cpp
        │   │   ├── MessageBox.h
        │   │   ├── PreferenceConfig.h
        │   │   ├── PreferenceForm.cpp
        │   │   ├── PreferenceForm.h
        │   │   ├── SeletListForm.cpp
        │   │   ├── SeletListForm.h
        │   │   ├── SimpleMediaFilePlayer.cpp
        │   │   ├── SimpleMediaFilePlayer.h
        │   │   ├── TipsHelpForm.cpp
        │   │   ├── TipsHelpForm.h
        │   │   ├── XP3RepackForm.cpp
        │   │   ├── XP3RepackForm.h
        │   │   └── extension
        │   │   │   ├── ActionExtension.cpp
        │   │   │   ├── ActionExtension.h
        │   │   │   ├── UIExtension.cpp
        │   │   │   └── UIExtension.h
        │   ├── vkdefine.h
        │   ├── win32
        │   │   ├── ApplicationSpecialPath.h
        │   │   ├── CompatibleNativeFuncs.cpp
        │   │   ├── CompatibleNativeFuncs.h
        │   │   ├── ConfigFormUnit.cpp
        │   │   ├── ConfigFormUnit.h
        │   │   ├── DetectCPU.cpp
        │   │   ├── DetectCPU.h
        │   │   ├── EmergencyExit.cpp
        │   │   ├── EmergencyExit.h
        │   │   ├── HintWindow.cpp
        │   │   ├── HintWindow.h
        │   │   ├── ImeControl.h
        │   │   ├── MainFormUnit.cpp
        │   │   ├── MainFormUnit.h
        │   │   ├── MouseCursor.cpp
        │   │   ├── MouseCursor.h
        │   │   ├── Platform.cpp
        │   │   ├── SystemControl.cpp
        │   │   ├── SystemControl.h
        │   │   ├── TVPWindow.cpp
        │   │   ├── TVPWindow.h
        │   │   ├── TouchPoint.cpp
        │   │   ├── TouchPoint.h
        │   │   ├── VersionFormUnit.cpp
        │   │   ├── VersionFormUnit.h
        │   │   ├── WindowFormUnit.cpp
        │   │   ├── WindowFormUnit.h
        │   │   ├── WindowsUtil.cpp
        │   │   ├── WindowsUtil.h
        │   │   ├── config.h
        │   │   └── my_HintWindow.cpp
        │   └── win32type.h
        ├── extension
        │   ├── Extension.cpp
        │   └── Extension.h
        ├── movie
        │   ├── ffmpeg
        │   │   ├── AE.h
        │   │   ├── AEAudioFormat.h
        │   │   ├── AEChannelData.h
        │   │   ├── AEChannelInfo.cpp
        │   │   ├── AEChannelInfo.h
        │   │   ├── AEFactory.cpp
        │   │   ├── AEFactory.h
        │   │   ├── AEStream.h
        │   │   ├── AEStreamData.h
        │   │   ├── AEStreamInfo.cpp
        │   │   ├── AEStreamInfo.h
        │   │   ├── AEUtil.cpp
        │   │   ├── AEUtil.h
        │   │   ├── AudioCodec.h
        │   │   ├── AudioCodecFFmpeg.cpp
        │   │   ├── AudioCodecFFmpeg.h
        │   │   ├── AudioCodecPassthrough.cpp
        │   │   ├── AudioCodecPassthrough.h
        │   │   ├── AudioDevice.cpp
        │   │   ├── AudioDevice.h
        │   │   ├── BaseRenderer.cpp
        │   │   ├── BaseRenderer.h
        │   │   ├── BitstreamStats.cpp
        │   │   ├── BitstreamStats.h
        │   │   ├── Clock.cpp
        │   │   ├── Clock.h
        │   │   ├── CodecUtils.cpp
        │   │   ├── CodecUtils.h
        │   │   ├── Codecs.h
        │   │   ├── Demux.cpp
        │   │   ├── Demux.h
        │   │   ├── DemuxFFmpeg.cpp
        │   │   ├── DemuxFFmpeg.h
        │   │   ├── DemuxPacket.cpp
        │   │   ├── DemuxPacket.h
        │   │   ├── FactoryCodec.cpp
        │   │   ├── FactoryCodec.h
        │   │   ├── Geometry.h
        │   │   ├── IAudioCallback.h
        │   │   ├── IVideoPlayer.h
        │   │   ├── InputStream.cpp
        │   │   ├── InputStream.h
        │   │   ├── KRMovieDef.h
        │   │   ├── KRMovieLayer.cpp
        │   │   ├── KRMovieLayer.h
        │   │   ├── KRMoviePlayer.cpp
        │   │   ├── KRMoviePlayer.h
        │   │   ├── MathUtils.h
        │   │   ├── Message.cpp
        │   │   ├── Message.h
        │   │   ├── MessageQueue.cpp
        │   │   ├── MessageQueue.h
        │   │   ├── OptionInfo.h
        │   │   ├── ProcessInfo.cpp
        │   │   ├── ProcessInfo.h
        │   │   ├── Ref.h
        │   │   ├── RenderFlags.cpp
        │   │   ├── RenderFlags.h
        │   │   ├── RenderFormats.h
        │   │   ├── StreamInfo.cpp
        │   │   ├── StreamInfo.h
        │   │   ├── TVPMediaDemux.cpp
        │   │   ├── TVPMediaDemux.h
        │   │   ├── Thread.cpp
        │   │   ├── Thread.h
        │   │   ├── TimeUtils.cpp
        │   │   ├── TimeUtils.h
        │   │   ├── Timer.cpp
        │   │   ├── Timer.h
        │   │   ├── VideoCodec.cpp
        │   │   ├── VideoCodec.h
        │   │   ├── VideoCodecFFmpeg.cpp
        │   │   ├── VideoCodecFFmpeg.h
        │   │   ├── VideoPlayer.cpp
        │   │   ├── VideoPlayer.h
        │   │   ├── VideoPlayerAudio.cpp
        │   │   ├── VideoPlayerAudio.h
        │   │   ├── VideoPlayerVideo.cpp
        │   │   ├── VideoPlayerVideo.h
        │   │   ├── VideoReferenceClock.cpp
        │   │   ├── VideoReferenceClock.h
        │   │   ├── VideoRenderer.cpp
        │   │   ├── VideoRenderer.h
        │   │   ├── config.h
        │   │   └── krffmpeg.cpp
        │   └── krmovie.cpp
        ├── msg
        │   ├── MsgIntf.cpp
        │   ├── MsgIntf.h
        │   ├── MsgIntfInc.h
        │   └── win32
        │   │   ├── MsgImpl.cpp
        │   │   ├── MsgImpl.h
        │   │   ├── MsgLoad.cpp
        │   │   ├── OptionsDesc.cpp
        │   │   ├── OptionsDesc.h
        │   │   ├── ReadOptionDesc.cpp
        │   │   └── ReadOptionDesc.h
        ├── sound
        │   ├── ARM
        │   │   ├── WaveFunctionARM.cpp
        │   │   └── wavemix_arm.c
        │   ├── CDDAIntf.cpp
        │   ├── CDDAIntf.h
        │   ├── FFWaveDecoder.cpp
        │   ├── FFWaveDecoder.h
        │   ├── MIDIIntf.cpp
        │   ├── MIDIIntf.h
        │   ├── MathAlgorithms.cpp
        │   ├── MathAlgorithms.h
        │   ├── PhaseVocoderDSP.cpp
        │   ├── PhaseVocoderDSP.h
        │   ├── PhaseVocoderFilter.cpp
        │   ├── PhaseVocoderFilter.h
        │   ├── RingBuffer.h
        │   ├── SoundBufferBaseIntf.cpp
        │   ├── SoundBufferBaseIntf.h
        │   ├── VorbisWaveDecoder.cpp
        │   ├── VorbisWaveDecoder.h
        │   ├── WaveFormatConverter.cpp
        │   ├── WaveFormatConverter_SSE.cpp
        │   ├── WaveIntf.cpp
        │   ├── WaveIntf.h
        │   ├── WaveLoopManager.cpp
        │   ├── WaveLoopManager.h
        │   ├── WaveSegmentQueue.cpp
        │   ├── WaveSegmentQueue.h
        │   └── win32
        │   │   ├── CDDAImpl.cpp
        │   │   ├── CDDAImpl.h
        │   │   ├── MIDIImpl.cpp
        │   │   ├── MIDIImpl.h
        │   │   ├── SoundBufferBaseImpl.cpp
        │   │   ├── SoundBufferBaseImpl.h
        │   │   ├── WaveImpl.cpp
        │   │   ├── WaveImpl.h
        │   │   ├── WaveMixer.cpp
        │   │   ├── WaveMixer.h
        │   │   ├── kmp_pi.h
        │   │   ├── oldwaveunpacker.h
        │   │   ├── tvpsnd.c
        │   │   ├── tvpsnd.cpp
        │   │   ├── tvpsnd.h
        │   │   └── tvpsnd.idl
        ├── tjs2
        │   ├── tjs.cpp
        │   ├── tjs.h
        │   ├── tjs.tab.cpp
        │   ├── tjs.tab.h
        │   ├── tjs.tab.hpp
        │   ├── tjsArray.cpp
        │   ├── tjsArray.h
        │   ├── tjsBinarySerializer.cpp
        │   ├── tjsBinarySerializer.h
        │   ├── tjsByteCodeLoader.cpp
        │   ├── tjsByteCodeLoader.h
        │   ├── tjsCommHead.h
        │   ├── tjsCompileControl.cpp
        │   ├── tjsCompileControl.h
        │   ├── tjsConfig.cpp
        │   ├── tjsConfig.h
        │   ├── tjsConstArrayData.cpp
        │   ├── tjsConstArrayData.h
        │   ├── tjsDate.cpp
        │   ├── tjsDate.h
        │   ├── tjsDateParser.cpp
        │   ├── tjsDateParser.h
        │   ├── tjsDateWordMap.cc
        │   ├── tjsDebug.cpp
        │   ├── tjsDebug.h
        │   ├── tjsDictionary.cpp
        │   ├── tjsDictionary.h
        │   ├── tjsDisassemble.cpp
        │   ├── tjsError.cpp
        │   ├── tjsError.h
        │   ├── tjsErrorDefs.h
        │   ├── tjsErrorInc.h
        │   ├── tjsError_jp.h
        │   ├── tjsException.cpp
        │   ├── tjsException.h
        │   ├── tjsGlobalStringMap.cpp
        │   ├── tjsGlobalStringMap.h
        │   ├── tjsHashSearch.h
        │   ├── tjsInterCodeExec.cpp
        │   ├── tjsInterCodeExec.h
        │   ├── tjsInterCodeGen.cpp
        │   ├── tjsInterCodeGen.h
        │   ├── tjsInterface.cpp
        │   ├── tjsInterface.h
        │   ├── tjsLex.cpp
        │   ├── tjsLex.h
        │   ├── tjsMT19937ar-cok.cpp
        │   ├── tjsMT19937ar-cok.h
        │   ├── tjsMath.cpp
        │   ├── tjsMath.h
        │   ├── tjsMessage.cpp
        │   ├── tjsMessage.h
        │   ├── tjsNamespace.cpp
        │   ├── tjsNamespace.h
        │   ├── tjsNative.cpp
        │   ├── tjsNative.h
        │   ├── tjsObject.cpp
        │   ├── tjsObject.h
        │   ├── tjsObjectExtendable.cpp
        │   ├── tjsObjectExtendable.h
        │   ├── tjsOctPack.cpp
        │   ├── tjsOctPack.h
        │   ├── tjsRandomGenerator.cpp
        │   ├── tjsRandomGenerator.h
        │   ├── tjsRegExp.cpp
        │   ├── tjsRegExp.h
        │   ├── tjsScriptBlock.cpp
        │   ├── tjsScriptBlock.h
        │   ├── tjsScriptCache.cpp
        │   ├── tjsScriptCache.h
        │   ├── tjsString.cpp
        │   ├── tjsString.h
        │   ├── tjsTypes.h
        │   ├── tjsUtils.cpp
        │   ├── tjsUtils.h
        │   ├── tjsVariant.cpp
        │   ├── tjsVariant.h
        │   ├── tjsVariantString.cpp
        │   ├── tjsVariantString.h
        │   ├── tjsdate.tab.cpp
        │   ├── tjsdate.tab.h
        │   ├── tjsdate.tab.hpp
        │   ├── tjspp.tab.cpp
        │   └── tjspp.tab.hpp
        ├── utils
        │   ├── ClipboardIntf.cpp
        │   ├── ClipboardIntf.h
        │   ├── DebugIntf.cpp
        │   ├── DebugIntf.h
        │   ├── Debugger.h
        │   ├── Exception.h
        │   ├── FilePathUtil.h
        │   ├── KAGParser.cpp
        │   ├── KAGParser.h
        │   ├── MathAlgorithms.h
        │   ├── MathAlgorithms_Default.cpp
        │   ├── MathAlgorithms_Default.h
        │   ├── MiscUtility.cpp
        │   ├── ObjectList.h
        │   ├── PadIntf.cpp
        │   ├── PadIntf.h
        │   ├── Random.cpp
        │   ├── Random.h
        │   ├── RealFFT.h
        │   ├── RealFFT_Default.cpp
        │   ├── StringUtil.h
        │   ├── ThreadIntf.cpp
        │   ├── ThreadIntf.h
        │   ├── TickCount.cpp
        │   ├── TickCount.h
        │   ├── TimerIntf.cpp
        │   ├── TimerIntf.h
        │   ├── VelocityTracker.cpp
        │   ├── VelocityTracker.h
        │   ├── encoding
        │   │   ├── gbk2unicode.c
        │   │   └── jis2unicode.c
        │   ├── iconv
        │   │   ├── iconv.h
        │   │   └── utf8.h
        │   ├── md5.c
        │   ├── md5.h
        │   ├── minizip
        │   │   ├── crypt.h
        │   │   ├── ioapi.cpp
        │   │   ├── ioapi.h
        │   │   ├── unzip.c
        │   │   ├── unzip.h
        │   │   ├── zip.c
        │   │   └── zip.h
        │   └── win32
        │   │   ├── ClipboardImpl.cpp
        │   │   ├── ClipboardImpl.h
        │   │   ├── DebugImpl.cpp
        │   │   ├── DebugImpl.h
        │   │   ├── PadImpl.cpp
        │   │   ├── PadImpl.h
        │   │   ├── TVPTimer.cpp
        │   │   ├── TVPTimer.h
        │   │   ├── ThreadImpl.cpp
        │   │   ├── ThreadImpl.h
        │   │   ├── TimerImpl.cpp
        │   │   └── TimerImpl.h
        └── visual
        │   ├── ARM
        │       ├── AlphaMovie_mjpeg.h
        │       ├── tvpgl_arm.cpp
        │       └── tvpgl_arm_intf.h
        │   ├── BitmapIntf.cpp
        │   ├── BitmapIntf.h
        │   ├── BitmapLayerTreeOwner.cpp
        │   ├── BitmapLayerTreeOwner.h
        │   ├── CharacterData.cpp
        │   ├── CharacterData.h
        │   ├── ComplexRect.cpp
        │   ├── ComplexRect.h
        │   ├── FontImpl.cpp
        │   ├── FontImpl.h
        │   ├── FontRasterizer.h
        │   ├── FontSystem.cpp
        │   ├── FontSystem.h
        │   ├── FreeType.cpp
        │   ├── FreeType.h
        │   ├── FreeTypeFace.h
        │   ├── FreeTypeFontRasterizer.cpp
        │   ├── FreeTypeFontRasterizer.h
        │   ├── GraphicsLoadThread.cpp
        │   ├── GraphicsLoadThread.h
        │   ├── GraphicsLoaderIntf.cpp
        │   ├── GraphicsLoaderIntf.h
        │   ├── ImageFunction.cpp
        │   ├── ImageFunction.h
        │   ├── LayerBitmapIntf.cpp
        │   ├── LayerBitmapIntf.h
        │   ├── LayerIntf.cpp
        │   ├── LayerIntf.h
        │   ├── LayerManager.cpp
        │   ├── LayerManager.h
        │   ├── LayerTreeOwner.h
        │   ├── LayerTreeOwnerImpl.cpp
        │   ├── LayerTreeOwnerImpl.h
        │   ├── LoadBPG.cpp
        │   ├── LoadJPEG.cpp
        │   ├── LoadJXR.cpp
        │   ├── LoadPNG.cpp
        │   ├── LoadPVRv3.cpp
        │   ├── LoadTLG.cpp
        │   ├── LoadTLG.h
        │   ├── LoadWEBP.cpp
        │   ├── MenuItemIntf.cpp
        │   ├── MenuItemIntf.h
        │   ├── PrerenderedFont.cpp
        │   ├── PrerenderedFont.h
        │   ├── RectItf.cpp
        │   ├── RectItf.h
        │   ├── RenderManager.cpp
        │   ├── RenderManager.h
        │   ├── RenderManager_software.h
        │   ├── SaveTLG.h
        │   ├── SaveTLG5.cpp
        │   ├── SaveTLG6.cpp
        │   ├── TransIntf.cpp
        │   ├── TransIntf.h
        │   ├── VideoOvlIntf.cpp
        │   ├── VideoOvlIntf.h
        │   ├── WindowIntf.cpp
        │   ├── WindowIntf.h
        │   ├── argb.cpp
        │   ├── argb.h
        │   ├── drawable.h
        │   ├── gl
        │       ├── ResampleImage.cpp
        │       ├── ResampleImage.h
        │       ├── ResampleImageInternal.h
        │       ├── WeightFunctor.cpp
        │       ├── WeightFunctor.h
        │       ├── blend_function.cpp
        │       ├── blend_functor_c.h
        │       ├── blend_util_func.h
        │       ├── blend_variation.h
        │       └── tvpgl_mathutil.h
        │   ├── ogl
        │       ├── RenderManager_ogl.cpp
        │       ├── RenderManager_ogl_test.hpp
        │       ├── astcrt.cpp
        │       ├── astcrt.h
        │       ├── etcpak.cpp
        │       ├── etcpak.h
        │       ├── imagepacker.cpp
        │       ├── imagepacker.h
        │       ├── ogl_common.h
        │       ├── pvr.h
        │       ├── pvrtc.cpp
        │       └── pvrtc.h
        │   ├── transhandler.h
        │   ├── tvpfontstruc.h
        │   ├── tvpgl.cpp
        │   ├── tvpgl.h
        │   ├── tvpgl_asm_init.h
        │   ├── tvphal.h
        │   ├── tvpinputdefs.h
        │   ├── tvpps.inc
        │   ├── voMode.h
        │   └── win32
        │       ├── BasicDrawDevice.cpp
        │       ├── BasicDrawDevice.h
        │       ├── BitmapBitsAlloc.cpp
        │       ├── BitmapBitsAlloc.h
        │       ├── BitmapInfomation.cpp
        │       ├── BitmapInfomation.h
        │       ├── DInputMgn.cpp
        │       ├── DInputMgn.h
        │       ├── DrawDevice.cpp
        │       ├── DrawDevice.h
        │       ├── GDIFontRasterizer.cpp
        │       ├── GDIFontRasterizer.h
        │       ├── GraphicsLoaderImpl.cpp
        │       ├── GraphicsLoaderImpl.h
        │       ├── LayerBitmapImpl.cpp
        │       ├── LayerBitmapImpl.h
        │       ├── LayerImpl.cpp
        │       ├── LayerImpl.h
        │       ├── MenuItemImpl.cpp
        │       ├── MenuItemImpl.h
        │       ├── NativeFreeTypeFace.cpp
        │       ├── NativeFreeTypeFace.h
        │       ├── PassThroughDrawDevice.cpp
        │       ├── PassThroughDrawDevice.h
        │       ├── TVPColor.h
        │       ├── TVPScreen.cpp
        │       ├── TVPScreen.h
        │       ├── TVPSysFont.cpp
        │       ├── TVPSysFont.h
        │       ├── VSyncTimingThread.cpp
        │       ├── VSyncTimingThread.h
        │       ├── VideoOvlImpl.cpp
        │       ├── VideoOvlImpl.h
        │       ├── WindowImpl.cpp
        │       ├── WindowImpl.h
        │       └── krmovie.h
    └── plugins
        ├── Android.mk
        ├── InternalPlugins.cpp
        ├── LayerExBase.cpp
        ├── LayerExBase.h
        ├── PluginStub.h
        ├── addFont.cpp
        ├── csvParser.cpp
        ├── dirlist.cpp
        ├── fftgraph.cpp
        ├── getSample.cpp
        ├── getabout.cpp
        ├── layerExBase.hpp
        ├── layerExMovie.cpp
        ├── layerExPerspective.cpp
        ├── ncbind
            ├── ncb_foreach.h
            ├── ncb_invoke.hpp
            ├── ncbind.cpp
            └── ncbind.hpp
        ├── saveStruct.cpp
        ├── tp_stub.h
        ├── varfile.cpp
        ├── win32dialog.cpp
        ├── wutcwf.cpp
        ├── xp3filter.cpp
        └── xp3filter.h


/cocos/kr2/.cocos-project.json:
--------------------------------------------------------------------------------
1 | {
2 |     "engine_type": "prebuilt", 
3 |     "engine_version": "cocos2d-x-3.6", 
4 |     "project_type": "cpp"
5 | }


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/Cancel_Normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/Cancel_Normal.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/Cancel_Press.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/Cancel_Press.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/CheckBoxNode_Normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/CheckBoxNode_Normal.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/CheckBoxNode_Press.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/CheckBoxNode_Press.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/CheckBox_Disable.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/CheckBox_Disable.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/CheckBox_Normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/CheckBox_Normal.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/CheckBox_Press.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/CheckBox_Press.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/about_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/about_icon.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/back_btn_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/back_btn_off.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/back_btn_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/back_btn_on.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/back_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/back_icon.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/circle_arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/circle_arrow.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/circle_arrow_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/circle_arrow_normal.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/circle_arrow_press.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/circle_arrow_press.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/circle_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/circle_white.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/empty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/empty.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/exit_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/exit_icon.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/gray.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/gray.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/keyboard_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/keyboard_icon.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/menu_handler.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/menu_handler.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/menu_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/menu_icon.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/menu_press.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/menu_press.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/mouse_2btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/mouse_2btn.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/mouse_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/mouse_icon.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/mouse_left_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/mouse_left_btn.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/mouse_right_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/mouse_right_btn.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/right_triangle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/right_triangle.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/syssetting_btn_ff.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/syssetting_btn_ff.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/syssetting_btn_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/syssetting_btn_on.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/touch1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/touch1.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/touch2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/touch2.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/touch_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/touch_icon.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/triangle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/triangle.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/white.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/img/windows_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/img/windows_icon.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/mouse_2btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/mouse_2btn.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/mouse_left_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/mouse_left_btn.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/mouse_right_btn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/cocos/kr2/cocosstudio/mouse_right_btn.png


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/ui/BottomBar.csd:
--------------------------------------------------------------------------------
 1 | <GameFile>
 2 |   <PropertyGroup Name="BottomBar" Type="Layer" ID="d6e3d7ad-9136-4e50-9628-78faf448d52c" Version="3.10.0.0" />
 3 |   <Content ctype="GameProjectContent">
 4 |     <Content>
 5 |       <Animation Duration="0" Speed="1.0000" />
 6 |       <ObjectData Name="Layer" Tag="47" ctype="GameLayerObjectData">
 7 |         <Size X="720.0000" Y="96.0000" />
 8 |         <Children>
 9 |           <AbstractNodeData Name="panel" ActionTag="-1964975631" Tag="52" IconVisible="False" PositionPercentYEnabled="True" HorizontalEdge="BothEdge" TouchEnable="True" StretchWidthEnable="True" StretchHeightEnable="True" ClipAble="False" ComboBoxIndex="1" ColorAngle="90.0000" ScrollDirectionType="0" ItemMargin="8" VerticalType="Align_VerticalCenter" ctype="ListViewObjectData">
10 |             <Size X="720.0000" Y="96.0000" />
11 |             <AnchorPoint ScaleX="0.5000" ScaleY="0.5000" />
12 |             <Position X="360.0000" Y="48.0000" />
13 |             <Scale ScaleX="1.0000" ScaleY="1.0000" />
14 |             <CColor A="255" R="255" G="255" B="255" />
15 |             <PrePosition X="0.5000" Y="0.5000" />
16 |             <PreSize X="1.0000" Y="1.0000" />
17 |             <SingleColor A="255" R="42" G="42" B="42" />
18 |             <FirstColor A="255" R="150" G="150" B="255" />
19 |             <EndColor A="255" R="255" G="255" B="255" />
20 |             <ColorVector ScaleY="1.0000" />
21 |           </AbstractNodeData>
22 |         </Children>
23 |       </ObjectData>
24 |     </Content>
25 |   </Content>
26 | </GameFile>


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/ui/ListItem.csd:
--------------------------------------------------------------------------------
 1 | <GameFile>
 2 |   <PropertyGroup Name="ListItem" Type="Layer" ID="e5c95844-665a-46e4-afbd-60543ed667b5" Version="3.10.0.0" />
 3 |   <Content ctype="GameProjectContent">
 4 |     <Content>
 5 |       <Animation Duration="0" Speed="1.0000" />
 6 |       <ObjectData Name="Layer" Tag="57" ctype="GameLayerObjectData">
 7 |         <Size X="720.0000" Y="96.0000" />
 8 |         <Children>
 9 |           <AbstractNodeData Name="item" ActionTag="18966105" Tag="59" IconVisible="False" HorizontalEdge="BothEdge" VerticalEdge="BothEdge" TouchEnable="True" StretchWidthEnable="True" StretchHeightEnable="True" FontSize="64" Scale9Enable="True" Scale9Width="1" Scale9Height="1" OutlineSize="0" ShadowOffsetX="0.0000" ShadowOffsetY="0.0000" ctype="ButtonObjectData">
10 |             <Size X="720.0000" Y="96.0000" />
11 |             <AnchorPoint ScaleX="0.5000" ScaleY="0.5000" />
12 |             <Position X="360.0000" Y="48.0000" />
13 |             <Scale ScaleX="1.0000" ScaleY="1.0000" />
14 |             <CColor A="255" R="255" G="255" B="255" />
15 |             <PrePosition X="0.5000" Y="0.5000" />
16 |             <PreSize X="0.0014" Y="0.0104" />
17 |             <FontResource Type="Normal" Path="DroidSansFallback.ttf" Plist="" />
18 |             <TextColor A="255" R="255" G="255" B="255" />
19 |             <DisabledFileData Type="Normal" Path="img/empty.png" Plist="" />
20 |             <PressedFileData Type="Normal" Path="img/gray.png" Plist="" />
21 |             <NormalFileData Type="Normal" Path="img/empty.png" Plist="" />
22 |             <OutlineColor A="255" R="255" G="0" B="0" />
23 |             <ShadowColor A="255" R="110" G="110" B="110" />
24 |           </AbstractNodeData>
25 |         </Children>
26 |       </ObjectData>
27 |     </Content>
28 |   </Content>
29 | </GameFile>


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/ui/ListView.csd:
--------------------------------------------------------------------------------
 1 | <GameFile>
 2 |   <PropertyGroup Name="ListView" Type="Layer" ID="c3c5322b-fc57-4810-92d1-7bc184317759" Version="3.10.0.0" />
 3 |   <Content ctype="GameProjectContent">
 4 |     <Content>
 5 |       <Animation Duration="0" Speed="1.0000" />
 6 |       <ObjectData Name="Layer" Tag="12" ctype="GameLayerObjectData">
 7 |         <Size X="720.0000" Y="960.0000" />
 8 |         <Children>
 9 |           <AbstractNodeData Name="list" ActionTag="1488899371" Tag="13" IconVisible="False" TouchEnable="True" StretchWidthEnable="True" StretchHeightEnable="True" ClipAble="False" ComboBoxIndex="1" ColorAngle="90.0000" IsBounceEnabled="True" ScrollDirectionType="0" ItemMargin="11" DirectionType="Vertical" ctype="ListViewObjectData">
10 |             <Size X="720.0000" Y="960.0000" />
11 |             <AnchorPoint />
12 |             <Position />
13 |             <Scale ScaleX="1.0000" ScaleY="1.0000" />
14 |             <CColor A="255" R="255" G="255" B="255" />
15 |             <PrePosition />
16 |             <PreSize X="1.0000" Y="1.0000" />
17 |             <SingleColor A="255" R="42" G="42" B="42" />
18 |             <FirstColor A="255" R="150" G="150" B="255" />
19 |             <EndColor A="255" R="255" G="255" B="255" />
20 |             <ColorVector ScaleY="1.0000" />
21 |           </AbstractNodeData>
22 |         </Children>
23 |       </ObjectData>
24 |     </Content>
25 |   </Content>
26 | </GameFile>


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/ui/SelectListItem.csd:
--------------------------------------------------------------------------------
 1 | <GameFile>
 2 |   <PropertyGroup Name="SelectListItem" Type="Layer" ID="554ef725-5acc-490d-a2b6-54230ba7700a" Version="3.10.0.0" />
 3 |   <Content ctype="GameProjectContent">
 4 |     <Content>
 5 |       <Animation Duration="0" Speed="1.0000" />
 6 |       <ObjectData Name="Layer" Tag="42" ctype="GameLayerObjectData">
 7 |         <Size X="640.0000" Y="96.0000" />
 8 |         <Children>
 9 |           <AbstractNodeData Name="text" ActionTag="-832335906" Tag="43" IconVisible="False" PercentWidthEnable="True" PercentHeightEnable="True" PercentWidthEnabled="True" PercentHeightEnabled="True" IsCustomSize="True" FontSize="72" LabelText="Text Label" HorizontalAlignmentType="HT_Center" VerticalAlignmentType="VT_Center" OutlineSize="0" ShadowOffsetX="0.0000" ShadowOffsetY="0.0000" ctype="TextObjectData">
10 |             <Size X="640.0000" Y="96.0000" />
11 |             <AnchorPoint />
12 |             <Position />
13 |             <Scale ScaleX="1.0000" ScaleY="1.0000" />
14 |             <CColor A="255" R="255" G="255" B="255" />
15 |             <PrePosition />
16 |             <PreSize X="1.0000" Y="1.0000" />
17 |             <FontResource Type="Normal" Path="DroidSansFallback.ttf" Plist="" />
18 |             <OutlineColor A="255" R="255" G="0" B="0" />
19 |             <ShadowColor A="255" R="255" G="127" B="80" />
20 |           </AbstractNodeData>
21 |         </Children>
22 |       </ObjectData>
23 |     </Content>
24 |   </Content>
25 | </GameFile>


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/ui/TableView.csd:
--------------------------------------------------------------------------------
 1 | <GameFile>
 2 |   <PropertyGroup Name="TableView" Type="Layer" ID="23410f2e-2ffa-4490-ba35-5eb7172f5c97" Version="3.10.0.0" />
 3 |   <Content ctype="GameProjectContent">
 4 |     <Content>
 5 |       <Animation Duration="0" Speed="1.0000" />
 6 |       <ObjectData Name="Layer" Tag="12" ctype="GameLayerObjectData">
 7 |         <Size X="720.0000" Y="960.0000" />
 8 |         <Children>
 9 |           <AbstractNodeData Name="table" ActionTag="1520823067" Tag="36" IconVisible="False" HorizontalEdge="BothEdge" VerticalEdge="BothEdge" TouchEnable="True" StretchWidthEnable="True" StretchHeightEnable="True" ClipAble="False" ComboBoxIndex="1" ColorAngle="90.0000" ctype="PanelObjectData">
10 |             <Size X="720.0000" Y="960.0000" />
11 |             <AnchorPoint />
12 |             <Position />
13 |             <Scale ScaleX="1.0000" ScaleY="1.0000" />
14 |             <CColor A="255" R="255" G="255" B="255" />
15 |             <PrePosition />
16 |             <PreSize X="0.2778" Y="0.2083" />
17 |             <SingleColor A="255" R="42" G="42" B="42" />
18 |             <FirstColor A="255" R="150" G="200" B="255" />
19 |             <EndColor A="255" R="255" G="255" B="255" />
20 |             <ColorVector ScaleY="1.0000" />
21 |           </AbstractNodeData>
22 |         </Children>
23 |       </ObjectData>
24 |     </Content>
25 |   </Content>
26 | </GameFile>


--------------------------------------------------------------------------------
/cocos/kr2/cocosstudio/ui/comctrl/SeperateItem.csd:
--------------------------------------------------------------------------------
 1 | <GameFile>
 2 |   <PropertyGroup Name="SeperateItem" Type="Layer" ID="3a906c4c-e6a3-497b-96d8-bcea8cd53981" Version="3.10.0.0" />
 3 |   <Content ctype="GameProjectContent">
 4 |     <Content>
 5 |       <Animation Duration="0" Speed="1.0000" />
 6 |       <ObjectData Name="Layer" Tag="7" ctype="GameLayerObjectData">
 7 |         <Size X="640.0000" Y="5.0000" />
 8 |         <Children>
 9 |           <AbstractNodeData Name="Panel_2" ActionTag="39795932" Tag="12" IconVisible="False" HorizontalEdge="BothEdge" VerticalEdge="BothEdge" TouchEnable="True" StretchWidthEnable="True" StretchHeightEnable="True" ClipAble="False" ComboBoxIndex="1" ColorAngle="90.0000" ctype="PanelObjectData">
10 |             <Size X="640.0000" Y="5.0000" />
11 |             <AnchorPoint />
12 |             <Position />
13 |             <Scale ScaleX="1.0000" ScaleY="1.0000" />
14 |             <CColor A="255" R="255" G="255" B="255" />
15 |             <PrePosition />
16 |             <PreSize X="1.0000" Y="1.0000" />
17 |             <SingleColor A="255" R="162" G="162" B="162" />
18 |             <FirstColor A="255" R="150" G="200" B="255" />
19 |             <EndColor A="255" R="255" G="255" B="255" />
20 |             <ColorVector ScaleY="1.0000" />
21 |           </AbstractNodeData>
22 |         </Children>
23 |       </ObjectData>
24 |     </Content>
25 |   </Content>
26 | </GameFile>


--------------------------------------------------------------------------------
/cocos/kr2/kr2.cfg:
--------------------------------------------------------------------------------
 1 | <SolutionConfig Version="3.10.0.0">
 2 |   <PublishDirectory Value="Resources/res" />
 3 |   <PackageDirectory Value="package\" />
 4 |   <PublishType Value="Reference" />
 5 |   <SolutionSize Value="1280 * 720" />
 6 |   <ResolutionName Value="Android" />
 7 |   <DefaultSerializer Value="Serializer_FlatBuffers" />
 8 |   <CustomSerializer Value="Serializer_FlatBuffers" />
 9 |   <IsNameStandardized Value="False" />
10 |   <CustomProperties>
11 |     <Item Key="CCS_CocosPropertis">
12 |       <Value ctype="CocosProperties">
13 |         <SolutionCodeType Value="Complete" />
14 |         <ProgramLanguage Value="cpp" />
15 |         <CreateFrameworkVersion Value="cocos2d-x-3.6" />
16 |         <CurrentFrameworkVersion Value="cocos2d-x-3.6" />
17 |         <EngineType Value="Prebuilt" />
18 |       </Value>
19 |     </Item>
20 |   </CustomProperties>
21 | </SolutionConfig>


--------------------------------------------------------------------------------
/privacy_policy.txt:
--------------------------------------------------------------------------------
1 | Privacy Policy
2 | 
3 | This APP will not collect and store your personal information in any form, including account information and location information, advertising identification, device ID and other private information, and it is impossible to share your information with third parties or other users.
4 | 
5 | Privacy Policy Terms
6 | 
7 | By using this App, you agree to the terms and conditions of this Privacy Policy. If you do not agree to this policy, please do not use the App. We reserve the right to change, modify, add or delete parts of this policy at any time at our discretion. Please check this page periodically for any revisions. If you continue to use our App after the posting of any changes to these terms will mean that you have accepted those adjustments.
8 | 
9 | 


--------------------------------------------------------------------------------
/project/android/AndroidManifest.xml:
--------------------------------------------------------------------------------
 1 | <?xml version="1.0" encoding="utf-8"?>
 2 | <!-- Replace org.libsdl.app with the identifier of your game below, e.g.
 3 |      com.gamemaker.game
 4 | -->
 5 | <manifest xmlns:android="http://schemas.android.com/apk/res/android"
 6 |       package="org.tvp.kirikiri2"
 7 |       android:versionCode="64"
 8 |       android:versionName="1.3.4"
 9 |       android:installLocation="auto">
10 | 
11 |     <!-- Android 2.3.3 -->
12 |     <uses-sdk android:minSdkVersion="10"/>
13 | 
14 |     <!-- OpenGL ES 2.0 -->
15 |     <uses-feature android:glEsVersion="0x00020000" />
16 | 
17 |     <!-- Allow writing to external storage -->
18 |     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
19 |     <uses-permission android:name="com.android.vending.CHECK_LICENSE"/>
20 |     <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
21 |     <uses-permission android:name="android.permission.INTERNET"/>
22 |     <application android:label="@string/app_name"
23 |                  android:icon="@drawable/ic_launcher"
24 |                  android:allowBackup="true" android:resizeableActivity="true">
25 |         <meta-data android:name="android.app.lib_name"
26 |                    android:value="game" />
27 |         <activity android:name="Kirikiroid2"
28 |                   android:label="@string/app_name"
29 |                   android:screenOrientation="sensorLandscape"
30 |                   android:configChanges="keyboardHidden|orientation|screenSize"
31 |                   android:windowSoftInputMode="adjustPan" android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
32 |             <intent-filter>
33 |                 <action android:name="android.intent.action.MAIN" />
34 |                 <category android:name="android.intent.category.LAUNCHER" />
35 |             </intent-filter>
36 |         </activity>
37 |     </application>
38 | </manifest> 
39 | 


--------------------------------------------------------------------------------
/project/android/jni/Android.mk:
--------------------------------------------------------------------------------
 1 | #ndk-build MODULE_PATH=jni
 2 | 
 3 | LOCAL_PATH := $(call my-dir)
 4 | 
 5 | include $(CLEAR_VARS)
 6 | 
 7 | LOCAL_MODULE := kirikiri2
 8 | 
 9 | LOCAL_MODULE_FILENAME := libgame
10 | 
11 | LOCAL_SRC_FILES := src/SDL_android_main.cpp
12 | 
13 | LOCAL_LDLIBS := -lGLESv1_CM -llog -ldl -lGLESv2 -landroid -lm
14 | LOCAL_LDLIBS += -Wl,--wrap=malloc -Wl,--wrap=free -Wl,--wrap=realloc -Wl,--wrap=calloc
15 | 
16 | LOCAL_C_INCLUDES := \
17 | 	$(LOCAL_PATH)/../../../vendor/libgdiplus/src \
18 | 	$(LOCAL_PATH)/../../../vendor/google_breakpad/current/src \
19 | 	$(LOCAL_PATH)/../../../vendor/google_breakpad/current/src/common/android/include \
20 | 	$(LOCAL_PATH)/../../../src/core/environ \
21 | 	$(LOCAL_PATH)/../../../src/core/environ/android \
22 | 	$(LOCAL_PATH)/../../../src/core/tjs2 \
23 | 	$(LOCAL_PATH)/../../../src/core/base \
24 | 	$(LOCAL_PATH)/../../../src/core/visual \
25 | 	$(LOCAL_PATH)/../../../src/core/visual/win32 \
26 | 	$(LOCAL_PATH)/../../../src/core/sound \
27 | 	$(LOCAL_PATH)/../../../src/core/sound/win32 \
28 | 	$(LOCAL_PATH)/../../../src/core/utils \
29 | 				 
30 | LOCAL_WHOLE_STATIC_LIBRARIES := kr2plugin krkr2 krkr2_neon_opt cocos2dx_static
31 | #LOCAL_WHOLE_STATIC_LIBRARIES += tcmalloc
32 | LOCAL_STATIC_LIBRARIES := android-ndk-profiler
33 | LOCAL_CPPFLAGS += -Dtypeof=decltype
34 | 
35 | include $(BUILD_SHARED_LIBRARY)
36 | $(call import-module, core)
37 | $(call import-module, ARM_neon)
38 | $(call import-module, plugins)
39 | #$(call import-module, png) #cocos
40 | #$(call import-module, jpeg) #cocos
41 | $(call import-module, cocos)
42 | #$(call import-module, tcmalloc)
43 | #$(call import-module, ../../../vendor/libgdiplus/jni)


--------------------------------------------------------------------------------
/project/android/jni/Application.mk:
--------------------------------------------------------------------------------
1 | APP_STL := gnustl_static
2 | APP_CPPFLAGS := -fexceptions -std=c++11
3 | APP_CPPFLAGS += -O3 -DNDEBUG -Wno-inconsistent-missing-override
4 | #APP_CPPFLAGS += -D__DO_PROF__ -g -pg
5 | APP_ABI := armeabi-v7a
6 | APP_ABI += arm64-v8a
7 | APP_PLATFORM := android-10
8 | #NDK_TOOLCHAIN_VERSION := 4.9
9 | NDK_TOOLCHAIN_VERSION := clang


--------------------------------------------------------------------------------
/project/android/project.properties:
--------------------------------------------------------------------------------
 1 | # This file is automatically generated by Android Tools.
 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
 3 | #
 4 | # This file must be checked in Version Control Systems.
 5 | #
 6 | # To customize properties used by the Ant build system edit
 7 | # "ant.properties", and override values to adapt the script to your
 8 | # project structure.
 9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 | 
13 | # Project target.
14 | target=android-22
15 | android.library.reference.1=../../vendor/cocos2d-x/current/cocos/platform/android/java
16 | 


--------------------------------------------------------------------------------
/project/android/src/org/tvp/kirikiri2/Kirikiroid2.java:
--------------------------------------------------------------------------------
 1 | package org.tvp.kirikiri2;
 2 | 
 3 | import java.io.BufferedInputStream;
 4 | import java.io.File;
 5 | import java.io.FileInputStream;
 6 | import java.io.FileNotFoundException;
 7 | import java.io.FileOutputStream;
 8 | import java.io.IOException;
 9 | import java.io.UnsupportedEncodingException;
10 | import java.net.MalformedURLException;
11 | import java.net.URL;
12 | import java.net.URLConnection;
13 | import java.net.URLEncoder;
14 | import java.util.Date;
15 | 
16 | import android.app.AlertDialog;
17 | import android.app.ProgressDialog;
18 | import android.content.DialogInterface;
19 | import android.os.Bundle;
20 | import android.os.Environment;
21 | import android.os.Handler;
22 | import android.os.Message;
23 | 
24 | public class Kirikiroid2 extends KR2Activity {
25 | 
26 | 	@Override
27 | 	public int get_res_sd_operate_step() { return R.drawable.sd_operate_step; }
28 | }
29 | 


--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
 1 | Kirikiroid2 - A cross-platform port of Kirikiri2/KirikiriZ
 2 | ==========================================================
 3 | 
 4 | Based on most code from [Kirikiri2](http://kikyou.info/tvp/) and [KirikiriZ](https://github.com/krkrz/krkrz)
 5 | 
 6 | Video playback module modified from [kodi](https://github.com/xbmc/xbmc)
 7 | 
 8 | Some string code from [glibc](https://www.gnu.org/s/libc) and [Apple Libc](https://opensource.apple.com/source/Libc).
 9 | 
10 | Real-time texture codec modified from [etcpak](https://bitbucket.org/wolfpld/etcpak.git), [pvrtccompressor](https://bitbucket.org/jthlim/pvrtccompressor), [astcrt](https://github.com/daoo/astcrt)
11 | 
12 | Android storage accessing code from [AmazeFileManager](https://github.com/arpitkh96/AmazeFileManager)
13 | 


--------------------------------------------------------------------------------
/src/core/base/BinaryStream.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // Text read/write stream
10 | //---------------------------------------------------------------------------
11 | #ifndef BinaryStreamH
12 | #define BinaryStreamH
13 | 
14 | 
15 | #include "StorageIntf.h"
16 | 
17 | //---------------------------------------------------------------------------
18 | // BinaryStream Functions
19 | //---------------------------------------------------------------------------
20 | TJS_EXP_FUNC_DEF(tTJSBinaryStream *, TVPCreateBinaryStreamForRead, (const ttstr &name, const ttstr &modestr));
21 | TJS_EXP_FUNC_DEF(tTJSBinaryStream *, TVPCreateBinaryStreamForWrite, (const ttstr &name, const ttstr &modestr));
22 | //---------------------------------------------------------------------------
23 | 
24 | 
25 | #endif
26 | 


--------------------------------------------------------------------------------
/src/core/base/CharacterSet.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/base/CharacterSet.cpp


--------------------------------------------------------------------------------
/src/core/base/CharacterSet.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // Character code conversion
10 | //---------------------------------------------------------------------------
11 | 
12 | #ifndef __CharacterSet_H__
13 | #define __CharacterSet_H__
14 | 
15 | // various character conding conversion.
16 | // currently only utf-8 related functions are implemented.
17 | #include "tjsTypes.h"
18 | 
19 | 
20 | TJS_EXP_FUNC_DEF(tjs_int, TVPWideCharToUtf8String, (const tjs_char *in, char * out));
21 | TJS_EXP_FUNC_DEF(tjs_int, TVPUtf8ToWideCharString, (const char * in, tjs_char *out));
22 | 
23 | extern tjs_int TVPUtf8ToWideCharString(const char * in, tjs_uint length, tjs_char *out);
24 | 
25 | 
26 | #endif
27 | 


--------------------------------------------------------------------------------
/src/core/base/PluginIntf.cpp:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // "Plugins" class interface
10 | //---------------------------------------------------------------------------
11 | #include "tjsCommHead.h"
12 | 
13 | 
14 | #include "PluginIntf.h"
15 | #include "MsgIntf.h"
16 | 
17 | 
18 | //---------------------------------------------------------------------------
19 | // tTJSNC_Plugins
20 | //---------------------------------------------------------------------------
21 | tjs_uint32 tTJSNC_Plugins::ClassID = -1;
22 | tTJSNC_Plugins::tTJSNC_Plugins() : inherited(TJS_W("Plugins"))
23 | {
24 | 	// registration of native members
25 | 
26 | 	TJS_BEGIN_NATIVE_MEMBERS(Plugins)
27 | 	TJS_DECL_EMPTY_FINALIZE_METHOD
28 | //----------------------------------------------------------------------
29 | 
30 | //-- methods
31 | 
32 | //----------------------------------------------------------------------
33 | 
34 | //--properties
35 | 
36 | //---------------------------------------------------------------------------
37 | 
38 | 	TJS_END_NATIVE_MEMBERS
39 | }
40 | //---------------------------------------------------------------------------
41 | tTJSNativeInstance * tTJSNC_Plugins::CreateNativeInstance()
42 | {
43 | 	// this class cannot create an instance
44 | 	TVPThrowExceptionMessage(TVPCannotCreateInstance);
45 | 	return NULL;
46 | }
47 | //---------------------------------------------------------------------------
48 | 
49 | 


--------------------------------------------------------------------------------
/src/core/base/PluginIntf.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // "Plugins" class interface
10 | //---------------------------------------------------------------------------
11 | #ifndef PluginIntfH
12 | #define PluginIntfH
13 | 
14 | #include "tjsNative.h"
15 | #if 0
16 | #ifndef __stdcall
17 | #define __stdcall
18 | #endif
19 | #ifndef __cdecl
20 | #define __cdecl
21 | #endif
22 | #ifndef _stdcall
23 | #define _stdcall
24 | #endif
25 | #ifndef _cdecl
26 | #define _cdecl
27 | #endif
28 | #endif
29 | 
30 | //---------------------------------------------------------------------------
31 | // tTJSNC_Plugins : TJS Plugins class
32 | //---------------------------------------------------------------------------
33 | class tTJSNC_Plugins : public tTJSNativeClass
34 | {
35 | 	typedef tTJSNativeClass inherited;
36 | 
37 | public:
38 | 	tTJSNC_Plugins();
39 | 	static tjs_uint32 ClassID;
40 | 
41 | protected:
42 | 	tTJSNativeInstance *CreateNativeInstance();
43 | };
44 | //---------------------------------------------------------------------------
45 | extern tTJSNativeClass * TVPCreateNativeClass_Plugins();
46 | //---------------------------------------------------------------------------
47 | 
48 | 
49 | #endif
50 | 


--------------------------------------------------------------------------------
/src/core/base/ScriptMgnIntf.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/base/ScriptMgnIntf.cpp


--------------------------------------------------------------------------------
/src/core/base/SystemIntf.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // "System" class interface
10 | //---------------------------------------------------------------------------
11 | #ifndef SystemIntfH
12 | #define SystemIntfH
13 | #include "tjsNative.h"
14 | 
15 | //---------------------------------------------------------------------------
16 | // tTJSNC_System : TJS System class
17 | //---------------------------------------------------------------------------
18 | class tTJSNC_System : public tTJSNativeClass
19 | {
20 | 	typedef tTJSNativeClass inherited;
21 | 
22 | public:
23 | 	tTJSNC_System();
24 | 	static tjs_uint32 ClassID;
25 | 
26 | protected:
27 | 	tTJSNativeInstance *CreateNativeInstance();
28 | };
29 | //---------------------------------------------------------------------------
30 | extern tTJSNativeClass * TVPCreateNativeClass_System();
31 | //---------------------------------------------------------------------------
32 | 
33 | //---------------------------------------------------------------------------
34 | TJS_EXP_FUNC_DEF(ttstr, TVPGetPlatformName, ());
35 | 		// retrieve platform name (eg. "Win32")
36 | 		// implement in each platform.
37 | TJS_EXP_FUNC_DEF(ttstr, TVPGetOSName, ());
38 | 		// retrieve OS name
39 | 		// implement in each platform.
40 | extern void TVPFireOnApplicationActivateEvent(bool activate_or_deactivate);
41 | extern tjs_int TVPGetOSBits();
42 | //---------------------------------------------------------------------------
43 | #endif
44 | 


--------------------------------------------------------------------------------
/src/core/base/TextStream.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // Text read/write stream
10 | //---------------------------------------------------------------------------
11 | #ifndef TextStreamH
12 | #define TextStreamH
13 | 
14 | 
15 | #include "StorageIntf.h"
16 | 
17 | //---------------------------------------------------------------------------
18 | // TextStream Functions
19 | //---------------------------------------------------------------------------
20 | TJS_EXP_FUNC_DEF(iTJSTextReadStream *, TVPCreateTextStreamForRead, (const ttstr &name, const ttstr &modestr));
21 | TJS_EXP_FUNC_DEF(iTJSTextWriteStream *, TVPCreateTextStreamForWrite, (const ttstr &name, const ttstr &modestr));
22 | TJS_EXP_FUNC_DEF(void, TVPSetDefaultReadEncoding, (const ttstr& encoding));
23 | TJS_EXP_FUNC_DEF(const tjs_char*, TVPGetDefaultReadEncoding, ());
24 | bool TVPStringDecode(const void *p, int len, ttstr& result, ttstr encoding = "utf8");
25 | bool TVPStringEncode(const ttstr &s, std::string &result, ttstr encoding = "utf8");
26 | //---------------------------------------------------------------------------
27 | 
28 | #endif
29 | 


--------------------------------------------------------------------------------
/src/core/base/UserEvent.h:
--------------------------------------------------------------------------------
 1 | 
 2 | 
 3 | #ifndef __USER_EVENT_H__
 4 | #define __USER_EVENT_H__
 5 | 
 6 | #ifndef WM_APP
 7 | #define WM_APP 0x10000
 8 | #endif
 9 | #define TVP_EV_TIMER_THREAD			(WM_APP + 1)
10 | #define TVP_EV_WAVE_SND_BUF_THREAD	(TVP_EV_TIMER_THREAD + 1)
11 | #define TVP_EV_VSYNC_TIMING_THREAD	(TVP_EV_WAVE_SND_BUF_THREAD + 1)
12 | #define TVP_EV_CONTINUE_LIMIT_THREAD	(TVP_EV_VSYNC_TIMING_THREAD + 1)
13 | #define TVP_EV_DELIVER_EVENTS_DUMMY	(TVP_EV_CONTINUE_LIMIT_THREAD + 1)
14 | #define TVP_EV_KEEP_ALIVE			(TVP_EV_DELIVER_EVENTS_DUMMY + 1)
15 | #define TVP_EV_IMAGE_LOAD_THREAD	(TVP_EV_KEEP_ALIVE + 1)
16 | #define TVP_EV_WINDOW_RELEASE		(TVP_EV_IMAGE_LOAD_THREAD + 1)
17 | 
18 | #endif // __USER_EVENT_H__
19 | 
20 | 


--------------------------------------------------------------------------------
/src/core/base/common.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000-2007 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // TVP2 common header file
10 | //---------------------------------------------------------------------------
11 | 
12 | #ifndef __CommonH__
13 | #define __CommonH__
14 | 
15 | #include "tjsConfig.h"
16 | 
17 | #include "config.h"
18 | 
19 | #include <string>
20 | 
21 | 
22 | using namespace TJS;
23 | 
24 | typedef std::basic_string<tjs_char> stdstring;
25 | typedef std::basic_string<tjs_nchar> stdnstring;
26 | 
27 | 
28 | 
29 | #endif
30 | 
31 | 


--------------------------------------------------------------------------------
/src/core/base/win32/EventImpl.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // Script Event Handling and Dispatching
10 | //---------------------------------------------------------------------------
11 | #ifndef EventImplH
12 | #define EventImplH
13 | 
14 | #include "EventIntf.h"
15 | 
16 | //---------------------------------------------------------------------------
17 | #endif
18 | 


--------------------------------------------------------------------------------
/src/core/base/win32/FileSelector.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // File Selector dialog box
10 | //---------------------------------------------------------------------------
11 | #ifndef FileSelectorH
12 | #define FileSelectorH
13 | //---------------------------------------------------------------------------
14 | 
15 | #include "tjs.h"
16 | 
17 | 
18 | extern bool TVPSelectFile(iTJSDispatch2 *params);
19 | 
20 | #endif
21 | 


--------------------------------------------------------------------------------
/src/core/base/win32/FuncStubs.h:
--------------------------------------------------------------------------------
 1 | /*
 2 | 
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000-2009 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | /* This file is always generated by makestub.pl . */
 9 | /* Modification by hand will be lost. */
10 | 
11 | extern void TVPExportFunctions();
12 | 
13 | 


--------------------------------------------------------------------------------
/src/core/base/win32/NativeEventQueue.cpp:
--------------------------------------------------------------------------------
 1 | #include "tjsCommHead.h"
 2 | #include "NativeEventQueue.h"
 3 | #include "Application.h"
 4 | 
 5 | void NativeEventQueueImplement::PostEvent(const NativeEvent& ev) {
 6 | 	Application->PostUserMessage([this, ev](){ Dispatch(*const_cast<NativeEvent*>(&ev)); }, this);
 7 | }
 8 | 
 9 | void NativeEventQueueImplement::Clear(int msg)
10 | {
11 | 	Application->FilterUserMessage([this, msg](std::vector<std::tuple<void*, int, tTVPApplication::tMsg> > &lst){
12 | 		for (auto it = lst.begin(); it != lst.end();) {
13 | 			if (std::get<0>(*it) == this && (!msg || std::get<1>(*it) == msg)) {
14 | 				it = lst.erase(it);
15 | 			} else {
16 | 				++it;
17 | 			}
18 | 		}
19 | 	});
20 | }
21 | 
22 | 


--------------------------------------------------------------------------------
/src/core/base/win32/NativeEventQueue.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/base/win32/NativeEventQueue.h


--------------------------------------------------------------------------------
/src/core/base/win32/ScriptMgnImpl.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000-2007 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // TJS2 Script Managing
10 | //---------------------------------------------------------------------------
11 | #ifndef ScriptMgnImplH
12 | #define ScriptMgnImplH
13 | 
14 | 
15 | #include "ScriptMgnIntf.h"
16 | 
17 | 
18 | 
19 | 
20 | //---------------------------------------------------------------------------
21 | // TVPInitializeStartupScript
22 | //---------------------------------------------------------------------------
23 | extern void TVPInitializeStartupScript();
24 | //extern bool TVPCheckProcessLog(int argc, char *argv[]);
25 | 
26 | //---------------------------------------------------------------------------
27 | #endif
28 | 


--------------------------------------------------------------------------------
/src/core/base/win32/SusieArchive.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // Archive eXtractor Susie plug-in support
10 | //---------------------------------------------------------------------------
11 | #ifndef SusieArchiveH
12 | #define SusieArchiveH
13 | //---------------------------------------------------------------------------
14 | #include "StorageIntf.h"
15 | 
16 | void TVPLoadArchiveSPI(HINSTANCE inst);
17 | void TVPUnloadArchiveSPI(HINSTANCE inst);
18 | class tTVPArchive;
19 | tTVPArchive * TVPOpenSusieArchive(const ttstr & name);
20 | 
21 | #endif
22 | 


--------------------------------------------------------------------------------
/src/core/base/win32/SysInitImpl.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/base/win32/SysInitImpl.cpp


--------------------------------------------------------------------------------
/src/core/base/win32/SysInitImpl.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // System Initialization and Uninitialization
10 | //---------------------------------------------------------------------------
11 | #ifndef SysInitImplH
12 | #define SysInitImplH
13 | 
14 | //---------------------------------------------------------------------------
15 | extern void TVPDumpHWException();
16 | 
17 | extern void TVPInitializeBaseSystems();
18 | 
19 | extern ttstr TVPNativeProjectDir;
20 | extern ttstr TVPNativeDataPath;
21 | 
22 | extern bool TVPProjectDirSelected;
23 | extern void TVPEnsureDataPathDirectory();
24 | 
25 | 
26 | extern bool TVPExecuteUserConfig();
27 | 
28 | extern bool TVPTerminated;
29 | extern bool TVPTerminateOnWindowClose;
30 | extern bool TVPTerminateOnNoWindowStartup;
31 | extern int TVPTerminateCode;
32 | 
33 | //---------------------------------------------------------------------------
34 | 
35 | 
36 | #include "SysInitIntf.h"
37 | 
38 | #endif
39 | 


--------------------------------------------------------------------------------
/src/core/base/win32/SystemImpl.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/base/win32/SystemImpl.cpp


--------------------------------------------------------------------------------
/src/core/base/win32/SystemImpl.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // "System" class implementation
10 | //---------------------------------------------------------------------------
11 | #ifndef SystemImplH
12 | #define SystemImplH
13 | //---------------------------------------------------------------------------
14 | TJS_EXP_FUNC_DEF(bool, TVPGetAsyncKeyState, (tjs_uint keycode, bool getcurrent = true));
15 | //---------------------------------------------------------------------------
16 | extern void TVPPostApplicationActivateEvent();
17 | extern void TVPPostApplicationDeactivateEvent();
18 | extern bool TVPShellExecute(const ttstr &target, const ttstr &param);
19 | extern void TVPDoSaveSystemVariables();
20 | //---------------------------------------------------------------------------
21 | #endif
22 | 


--------------------------------------------------------------------------------
/src/core/base/win32/win32io.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #ifdef WIN32
 3 | // posix io api
 4 | extern "C" {
 5 | 	extern __int64 __cdecl lseek64(int _FileHandle, __int64 _Offset, int _Origin);
 6 | 	extern void* valloc(int n);
 7 | 	extern void vfree(void *p);
 8 | }
 9 | #endif
10 | #ifdef CC_TARGET_OS_IPHONE
11 | #define lseek64 lseek
12 | #endif


--------------------------------------------------------------------------------
/src/core/environ/Application.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/environ/Application.cpp


--------------------------------------------------------------------------------
/src/core/environ/Application.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/environ/Application.h


--------------------------------------------------------------------------------
/src/core/environ/ConfigManager/GlobalConfigManager.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include <unordered_map>
 3 | #include <string>
 4 | #include <vector>
 5 | #include <map>
 6 | 
 7 | class iSysConfigManager {
 8 | protected:
 9 | 	std::unordered_map<std::string, std::string> AllConfig;
10 | 	std::vector<std::pair<std::string, std::string> > CustomArguments;
11 | 	std::map<int, int> KeyMap;
12 | 
13 | 	bool ConfigUpdated;
14 | 
15 | 	virtual std::string GetFilePath() = 0;
16 | 
17 | 	void Initialize();
18 | 
19 | public:
20 | 	void SaveToFile();
21 | 
22 | 	bool IsValueExist(const std::string &name);
23 | 
24 | 	template<typename T>
25 | 	T GetValue(const std::string &name, const T& defVal);
26 | 
27 | 	void SetValueInt(const std::string &name, int val);
28 | 	void SetValueFloat(const std::string &name, float val);
29 | 	void SetValue(const std::string &name, const std::string & val);
30 | 
31 | 	std::vector<std::pair<std::string, std::string> > &GetCustomArgumentsForModify() {
32 | 		ConfigUpdated = true;
33 | 		return CustomArguments;
34 | 	}
35 | 
36 | 	const std::map<int, int>& GetKeyMap() { return KeyMap; }
37 | 	void SetKeyMap(int k, int v/* 0 means remove */);
38 | 
39 | 	const std::vector<std::pair<std::string, std::string> > &GetCustomArguments() const { return CustomArguments; }
40 | 
41 | 	std::vector<std::string> GetCustomArgumentsForPush();
42 | };
43 | 
44 | template<> bool iSysConfigManager::GetValue<bool>(const std::string &name, const bool& defVal);
45 | template<> int iSysConfigManager::GetValue<int>(const std::string &name, const int& defVal);
46 | template<> float iSysConfigManager::GetValue<float>(const std::string &name, const float& defVal);
47 | template<> std::string iSysConfigManager::GetValue<std::string>(const std::string &name, const std::string& defVal);
48 | 
49 | class GlobalConfigManager : public iSysConfigManager {
50 | 
51 | 	virtual std::string GetFilePath() override;
52 | 
53 | 	GlobalConfigManager();
54 | 
55 | public:
56 | 	static GlobalConfigManager* GetInstance();
57 | };


--------------------------------------------------------------------------------
/src/core/environ/ConfigManager/IndividualConfigManager.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include <unordered_map>
 3 | #include <string>
 4 | #include <vector>
 5 | #include "GlobalConfigManager.h"
 6 | 
 7 | class IndividualConfigManager : public iSysConfigManager {
 8 | 	typedef iSysConfigManager inherit;
 9 | 
10 | 	virtual std::string GetFilePath() override;
11 | 
12 | 	void Clear();
13 | 
14 | 	std::string CurrentPath;
15 | 
16 | public:
17 | 	static IndividualConfigManager* GetInstance();
18 | 	static bool CheckExistAt(const std::string &folder);
19 | 	bool CreatePreferenceAt(const std::string &folder);
20 | 	bool UsePreferenceAt(const std::string &folder);
21 | 
22 | 	template<typename T>
23 | 	T GetValue(const std::string &name, const T& defVal);
24 | 
25 | 	std::vector<std::string> GetCustomArgumentsForPush();
26 | };
27 | 
28 | template<> bool IndividualConfigManager::GetValue<bool>(const std::string &name, const bool& defVal);
29 | template<> int IndividualConfigManager::GetValue<int>(const std::string &name, const int& defVal);
30 | template<> float IndividualConfigManager::GetValue<float>(const std::string &name, const float& defVal);
31 | template<> std::string IndividualConfigManager::GetValue<std::string>(const std::string &name, const std::string& defVal);


--------------------------------------------------------------------------------
/src/core/environ/ConfigManager/LocaleConfigManager.h:
--------------------------------------------------------------------------------
 1 | // multi language config mainly for ui
 2 | #pragma once
 3 | #include <unordered_map>
 4 | #include <string>
 5 | #include <vector>
 6 | 
 7 | namespace cocos2d {
 8 | 	namespace ui {
 9 | 		class Text;
10 | 		class Button;
11 | 	}
12 | }
13 | 
14 | class LocaleConfigManager {
15 | 
16 | 	std::unordered_map<std::string, std::string> AllConfig; // tid->text in utf8
17 | 
18 | 	bool ConfigUpdated;
19 | 
20 | 	LocaleConfigManager();
21 | 
22 | 	std::string GetFilePath();
23 | 
24 | public:
25 | 	static LocaleConfigManager* GetInstance();
26 | 
27 | 	void Initialize(const std::string &sysLang);
28 | 
29 | 	const std::string &GetText(const std::string &tid); // in utf8
30 | 
31 | 	bool initText(cocos2d::ui::Text *ctrl);
32 | 	bool initText(cocos2d::ui::Button *ctrl);
33 | 	bool initText(cocos2d::ui::Text *ctrl, const std::string &tid);
34 | 	bool initText(cocos2d::ui::Button *ctrl, const std::string &tid);
35 | 
36 | private:
37 | 
38 | 	std::string currentLangCode;
39 | };


--------------------------------------------------------------------------------
/src/core/environ/DetectCPU.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000-2007 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // CPU idetification / features detection routine
10 | //---------------------------------------------------------------------------
11 | #ifndef DetectCPUH
12 | #define DetectCPUH
13 | //---------------------------------------------------------------------------
14 | extern "C"
15 | {
16 | 	extern tjs_uint32 TVPCPUType;
17 | }
18 | 
19 | extern void TVPDetectCPU();
20 | TJS_EXP_FUNC_DEF(tjs_uint32, TVPGetCPUType, ());
21 | 
22 | //---------------------------------------------------------------------------
23 | #endif
24 | 


--------------------------------------------------------------------------------
/src/core/environ/DumpSend.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/environ/DumpSend.cpp


--------------------------------------------------------------------------------
/src/core/environ/XP3ArchiveRepack.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include <string>
 3 | #include <vector>
 4 | #include <functional>
 5 | 
 6 | class XP3ArchiveRepackAsyncImpl;
 7 | class XP3ArchiveRepackAsync {
 8 | 
 9 | public:
10 | 	XP3ArchiveRepackAsync();
11 | 	~XP3ArchiveRepackAsync();
12 | 	uint64_t AddTask(const std::string &src);
13 | 	void Start();
14 | 	void Stop();
15 | 	void SetXP3Filter(const std::string &xp3filter);
16 | 	void SetCallback(
17 | 		const std::function<void(int, uint64_t, const std::string &)> &onNewFile,
18 | 		const std::function<void(int, uint64_t, const std::string &)> &onNewArchive,
19 | 		const std::function<void(uint64_t, uint64_t, uint64_t)> &onProgress,
20 | 		const std::function<void(int, const std::string &)> &onError,
21 | 		const std::function<void()> &onEnded);
22 | 
23 | 	void SetOption(const std::string &name, bool v);
24 | 
25 | private:
26 | 	XP3ArchiveRepackAsyncImpl *_impl;
27 | };
28 | 


--------------------------------------------------------------------------------
/src/core/environ/android/AndroidUtils.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/environ/android/AndroidUtils.cpp


--------------------------------------------------------------------------------
/src/core/environ/android/AndroidUtils.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include <jni.h>
3 | #include <string>
4 | 
5 | std::string TVPGetDeviceID();
6 | 


--------------------------------------------------------------------------------
/src/core/environ/cocos2d/AppDelegate.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include "cocos2d.h"
 3 | 
 4 | class TVPAppDelegate : public cocos2d::Application {
 5 | 
 6 | 	virtual void initGLContextAttrs();
 7 | 
 8 | 	/**
 9 | 	@brief    Implement Director and Scene init code here.
10 | 	@return true    Initialize success, app continue.
11 | 	@return false   Initialize failed, app terminate.
12 | 	*/
13 | 	virtual bool applicationDidFinishLaunching();
14 | 
15 | 	/**
16 | 	@brief  The function be called when the application enter background
17 | 	@param  the pointer of the application
18 | 	*/
19 | 	virtual void applicationDidEnterBackground();
20 | 
21 | 	/**
22 | 	@brief  The function be called when the application enter foreground
23 | 	@param  the pointer of the application
24 | 	*/
25 | 	virtual void applicationWillEnterForeground();
26 | 
27 | 	virtual void applicationScreenSizeChanged(int newWidth, int newHeight);
28 | };


--------------------------------------------------------------------------------
/src/core/environ/cocos2d/CCKeyCodeConv.h:
--------------------------------------------------------------------------------
1 | #include "tjsTypes.h"
2 | #include "tvpinputdefs.h"
3 | #include "cocos2d.h"
4 | 
5 | int TVPConvertMouseBtnToVKCode(tTVPMouseButton _mouseBtn);
6 | int TVPConvertKeyCodeToVKCode(cocos2d::EventKeyboard::KeyCode keyCode);
7 | int TVPConvertPadKeyCodeToVKCode(int keyCode);
8 | const std::unordered_map<std::string, int> &TVPGetVKCodeNameMap();
9 | std::string TVPGetVKCodeName(int keyCode);


--------------------------------------------------------------------------------
/src/core/environ/cocos2d/CustomFileUtils.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include "cocos2d.h"
 3 | 
 4 | void TVPAddAutoSearchArchive(const std::string &path);
 5 | class TVPSkinManager {
 6 | public:
 7 | 	static TVPSkinManager* getInstance();
 8 | 
 9 | 	void InitSkin();
10 | 	static bool Check(const std::string &skin_path);
11 | 	static void Reset();
12 | 	static bool Use(const std::string &skin_path);
13 | 	static bool InstallAndUse(const std::string &skin_path);
14 | };
15 | 


--------------------------------------------------------------------------------
/src/core/environ/cocos2d/CustomFileUtils.mm:
--------------------------------------------------------------------------------
1 | #include "CustomFileUtils.cpp"


--------------------------------------------------------------------------------
/src/core/environ/cocos2d/MainScene.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/environ/cocos2d/MainScene.cpp


--------------------------------------------------------------------------------
/src/core/environ/cocos2d/YUVSprite.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include "cocos2d.h"
 3 | 
 4 | class TVPYUVSprite : public cocos2d::Sprite {
 5 | 	cocos2d::Texture2D* _textureU = nullptr, *_textureV = nullptr;
 6 | 	cocos2d::Texture2D::PixelFormat _texfmtY = cocos2d::Texture2D::PixelFormat::NONE,
 7 | 		_texfmtU = cocos2d::Texture2D::PixelFormat::NONE,
 8 | 		_texfmtV = cocos2d::Texture2D::PixelFormat::NONE;
 9 | 	cocos2d::CustomCommand _drawCommand;
10 | 
11 | 	GLuint _buffersVAO;
12 | 	GLuint _buffersVBO[2]; //0: vertex  1: indices
13 | 
14 | 	void setupVBOAndVAO();
15 | 
16 | 	void updateTextureDataInternal(cocos2d::Texture2D *pTex, const void* data, int width, int height,
17 | 		cocos2d::Texture2D::PixelFormat pixfmt);
18 | 
19 | public:
20 | 	virtual ~TVPYUVSprite();
21 | 
22 | 	static TVPYUVSprite* create();
23 | 
24 | 	bool init();
25 | 
26 | 	void updateTextureData(const void* data, int width, int height);
27 | 
28 | 	void updateTextureData(
29 | 		const void* Y, int YW, int YH,
30 | 		const void* U, int UW, int UH,
31 | 		const void* V, int VW, int VH);
32 | 
33 | private:
34 | 	cocos2d::Mat4 _mv;
35 | 
36 | 	void onDraw();
37 | 
38 | 	void draw(cocos2d::Renderer *renderer, const cocos2d::Mat4 &transform, uint32_t flags) override;
39 | };
40 | 


--------------------------------------------------------------------------------
/src/core/environ/cpu_types.h:
--------------------------------------------------------------------------------
 1 | // ; this is a part of TVP (KIRIKIRI) software source.
 2 | // ; see other sources for license.
 3 | // ; (C)2001-2003 W.Dee <dee@kikyou.info> and contributors
 4 | // 
 5 | // ;;[emit_c_h]/*[*/
 6 | // ;;[emit_c_h]//---------------------------------------------------------------------------
 7 | // ;;[emit_c_h]// CPU Types
 8 | // ;;[emit_c_h]//---------------------------------------------------------------------------
 9 | // ;;[emit_c_h]/*]*/
10 | // 
11 | // ;;[emit_c_h_equ_begin]
12 | #pragma once
13 | 
14 | #define TVP_CPU_HAS_FPU			0x00010000
15 | #define TVP_CPU_HAS_MMX			0x00020000
16 | #define TVP_CPU_HAS_3DN			0x00040000
17 | #define TVP_CPU_HAS_SSE			0x00080000
18 | #define TVP_CPU_HAS_CMOV		0x00100000
19 | #define TVP_CPU_HAS_E3DN		0x00200000
20 | #define TVP_CPU_HAS_EMMX		0x00400000
21 | #define TVP_CPU_HAS_SSE2		0x00800000
22 | #define TVP_CPU_HAS_TSC			0x01000000
23 | #define TVP_CPU_HAS_NEON		0x02000000
24 | 
25 | #define TVP_CPU_FEATURE_MASK	0xffff0000
26 |     
27 | #define TVP_CPU_IS_INTEL		0x00000010
28 | #define TVP_CPU_IS_AMD			0x00000020
29 | #define TVP_CPU_IS_IDT			0x00000030
30 | #define TVP_CPU_IS_CYRIX		0x00000040
31 | #define TVP_CPU_IS_NEXGEN		0x00000050
32 | #define TVP_CPU_IS_RISE			0x00000060
33 | #define TVP_CPU_IS_UMC			0x00000070
34 | #define TVP_CPU_IS_TRANSMETA	0x00000080
35 | #define TVP_CPU_IS_UNKNOWN		0x00000000
36 | 
37 | #define TVP_CPU_VENDOR_MASK		0x00000ff0
38 |     
39 | #define TVP_CPU_FAMILY_X86      0x00000001
40 | #define TVP_CPU_FAMILY_X64      0x00000002
41 | #define TVP_CPU_FAMILY_ARM      0x00000003
42 | #define TVP_CPU_FAMILY_MIPS     0x00000003
43 | 
44 | #define TVP_CPU_FAMILY_MASK		0x0000000f
45 | 
46 | #ifdef __cplusplus
47 | extern "C" unsigned int TVPCPUFeatures;
48 | #else
49 | extern unsigned int TVPCPUFeatures;
50 | #endif
51 | 
52 | // ;;[emit_c_h_equ_end]
53 | // 
54 | // ; note: EMMX is refered to as MMX2
55 | 


--------------------------------------------------------------------------------
/src/core/environ/sdl/tvpsdl.cpp:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000-2007 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // TVP Win32 Project File
10 | //---------------------------------------------------------------------------
11 | #include "tjsCommHead.h"
12 | 
13 | #include <assert.h>
14 | //---------------------------------------------------------------------------
15 | void TVPOnError();
16 | //---------------------------------------------------------------------------
17 | #ifdef TVP_SUPPORT_ERI
18 | #	pragma link "../../../../Lib/liberina.lib"
19 | #endif
20 | //---------------------------------------------------------------------------
21 | #if defined(WIN32) && defined(_DEBUG)
22 | #include <new.h>
23 | #define TVP_MAIN_DEBUG
24 | //#include <vld.h>
25 | #include "GraphicsLoaderIntf.h"
26 | #include <set>
27 | #else
28 | #include <new>
29 | #endif
30 | #include "StorageIntf.h"
31 | #include <thread>
32 | #include "EventIntf.h"
33 | #include "Application.h"
34 | #include "SysInitImpl.h"
35 | #include "TickCount.h"
36 | #include "ScriptMgnIntf.h"
37 | #include "DebugIntf.h"
38 | //#include "PluginImpl.h"
39 | #include "ScriptMgnImpl.h"
40 | #include "SystemIntf.h"
41 | #include "ThreadIntf.h"
42 | #include "Platform.h"
43 | #include "ConfigManager/LocaleConfigManager.h"
44 | #include "Exception.h"
45 | 
46 | //#define HOOK_MALLOC_FOR_OVERRUN
47 | //#define TC_MALLOC
48 | 
49 | extern "C" void monstartup(const char *libname);
50 | 
51 | static bool tc_malloc_startup = false;
52 | 


--------------------------------------------------------------------------------
/src/core/environ/ui/ConsoleWindow.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | 
 3 | #include "2d/CCNode.h"
 4 | #include "2d/CCLabel.h"
 5 | #include <deque>
 6 | #include <vector>
 7 | #include "tjsCommHead.h"
 8 | 
 9 | class TVPConsoleWindow : public cocos2d::Node {
10 | 	TVPConsoleWindow();
11 | public:
12 | 	static TVPConsoleWindow* create(int fontSize, cocos2d::Node *parent);
13 | 
14 | 	void addLine(const ttstr &line, cocos2d::Color3B clr);
15 | 
16 | 	void setFontSize(float size);
17 | 
18 | 	virtual void visit(cocos2d::Renderer *renderer, const cocos2d::Mat4& parentTransform, uint32_t parentFlags) override;
19 | private:
20 | 	float _fontSize;
21 | 
22 | 	std::deque<cocos2d::Label*> _dispLabels;
23 | 	std::vector<cocos2d::Label*> _unusedLabels;
24 | 	std::deque<std::pair<ttstr, cocos2d::Color3B> > _queuedLines;
25 | 	unsigned int _maxQueueSize;
26 | };
27 | 


--------------------------------------------------------------------------------
/src/core/environ/ui/DebugViewLayerForm.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include "2d/CCNode.h"
 3 | #include "extensions/GUI/CCScrollView/CCTableView.h"
 4 | #include "2d/CCLabel.h"
 5 | 
 6 | class tTJSNI_BaseLayer;
 7 | class iTVPTexture2D;
 8 | class DebugViewLayerForm : public cocos2d::Node, public cocos2d::extension::TableViewDataSource {
 9 | public:
10 | 	static DebugViewLayerForm *create();
11 | 
12 | 	virtual bool init() override;
13 | 
14 | private:
15 | 	virtual cocos2d::Size tableCellSizeForIndex(cocos2d::extension::TableView *table, ssize_t idx) override;
16 | 	virtual cocos2d::extension::TableViewCell* tableCellAtIndex(cocos2d::extension::TableView *table, ssize_t idx) override;
17 | 	virtual ssize_t numberOfCellsInTableView(cocos2d::extension::TableView *table) override { return _layers.size(); }
18 | 	void onExitCallback();
19 | 	uint64_t addToLayerVec(int indent, const std::string &prefix, tTJSNI_BaseLayer* lay);
20 | 
21 | 	class DebugViewLayerCell;
22 | 	struct LayerInfo {
23 | 		std::string Name;
24 | 		iTVPTexture2D *Texture;
25 | 		size_t VMemSize;
26 | 		int Indent;
27 | 	};
28 | 
29 | 	cocos2d::Label *_totalSize;
30 | 	cocos2d::extension::TableView *_tableView;
31 | 	// pair<ident, layer>
32 | 	std::vector<LayerInfo> _layers;
33 | };


--------------------------------------------------------------------------------
/src/core/environ/ui/GameMainMenu.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include "BaseForm.h"
 3 | 
 4 | class TVPGameMainMenu : public cocos2d::Node {
 5 | public:
 6 | 	TVPGameMainMenu(GLubyte opa);
 7 | 	static TVPGameMainMenu *create(GLubyte opa);
 8 | 
 9 | 	virtual bool init() override;
10 | 
11 | 	void setMouseIcon(bool bMouse);
12 | 
13 | 	void shrink();
14 | 	void expand();
15 | 	void toggle();
16 | 	void shrinkWithTime(float dur);
17 | 	bool isShrinked();
18 | 
19 | private:
20 | 	bool onHandlerTouchBegan(cocos2d::Touch *touch, cocos2d::Event *unusedEvent);
21 | 	void onHandlerTouchMoved(cocos2d::Touch *touch, cocos2d::Event *unusedEvent);
22 | 	void onHandlerTouchEnded(cocos2d::Touch *touch, cocos2d::Event *unusedEvent);
23 | 	void onHandlerTouchCancelled(cocos2d::Touch *touch, cocos2d::Event *unusedEvent);
24 | 
25 | 	bool onBackgroundTouchBegan(cocos2d::Touch *touch, cocos2d::Event *unusedEvent);
26 | 	void onBackgroundTouchMoved(cocos2d::Touch *touch, cocos2d::Event *unusedEvent);
27 | 	void onBackgroundTouchEnded(cocos2d::Touch *touch, cocos2d::Event *unusedEvent);
28 | 	void onBackgroundTouchCancelled(cocos2d::Touch *touch, cocos2d::Event *unusedEvent);
29 | 
30 | 	GLubyte _handler_inactive_opacity;
31 | 	bool _hitted;
32 | 	bool _shrinked;
33 | 	bool _draggingX, _draggingY;
34 | 
35 | 	cocos2d::Node *_root;
36 | 	cocos2d::Node *_handler;
37 | 	cocos2d::Node *_icon_touch;
38 | 	cocos2d::Node *_icon_mouse;
39 | 
40 | 	cocos2d::Vec2 _touchBeganPosition;
41 | 	cocos2d::Vec2 _touchMovePosition;
42 | 	cocos2d::Vec2 _touchEndPosition;
43 | 
44 | 	unsigned int _touchBeganTime;
45 | };


--------------------------------------------------------------------------------
/src/core/environ/ui/GlobalPreferenceForm.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "PreferenceForm.h"
3 | 
4 | class TVPGlobalPreferenceForm : public TVPPreferenceForm {
5 | public:
6 | 	static TVPGlobalPreferenceForm *create(const tPreferenceScreen *config = nullptr);
7 | 	static void Initialize();
8 | };


--------------------------------------------------------------------------------
/src/core/environ/ui/InGameMenuForm.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include "PreferenceForm.h"
 3 | 
 4 | class tTJSNI_MenuItem;
 5 | 
 6 | class TVPInGameMenuForm : public iTVPBaseForm {
 7 | public:
 8 | 	static TVPInGameMenuForm *create(const std::string& title, tTJSNI_MenuItem *item);
 9 | 
10 | 	virtual void bindBodyController(const NodeMap &allNodes);
11 | 	virtual void bindHeaderController(const NodeMap &allNodes);
12 | 
13 | 	void initMenu(const std::string& title, tTJSNI_MenuItem *item);
14 | 
15 | private:
16 | 	cocos2d::ui::Widget *createMenuItem(int idx, tTJSNI_MenuItem *item, const std::string &caption);
17 | 
18 | 	cocos2d::ui::ListView *_list;
19 | 	cocos2d::ui::Button *_title;
20 | };


--------------------------------------------------------------------------------
/src/core/environ/ui/IndividualPreferenceForm.cpp:
--------------------------------------------------------------------------------
 1 | #include "IndividualPreferenceForm.h"
 2 | #include "ConfigManager/LocaleConfigManager.h"
 3 | #include "ui/UIButton.h"
 4 | #include "cocos2d/MainScene.h"
 5 | #include "ui/UIListView.h"
 6 | #include "platform/CCFileUtils.h"
 7 | #include "ConfigManager/IndividualConfigManager.h"
 8 | #include "Platform.h"
 9 | 
10 | using namespace cocos2d;
11 | using namespace cocos2d::ui;
12 | #define INDIVIDUAL_PREFERENCE
13 | 
14 | const char * const FileName_NaviBar = "ui/NaviBar.csb";
15 | const char * const FileName_Body = "ui/ListView.csb";
16 | #define TVPGlobalPreferenceForm IndividualPreferenceForm
17 | 
18 | static iSysConfigManager* GetConfigManager() {
19 | 	return IndividualConfigManager::GetInstance();
20 | }
21 | #include "PreferenceConfig.h"
22 | 
23 | #undef TVPGlobalPreferenceForm
24 | 
25 | static void initInividualConfig() {
26 | 	if (!RootPreference.Preferences.empty()) return;
27 | 	initAllConfig();
28 | 	RootPreference.Title = "preference_title_individual";
29 | }
30 | 
31 | IndividualPreferenceForm * IndividualPreferenceForm::create(const tPreferenceScreen *config) {
32 | 	initInividualConfig();
33 | 	if (!config) config = &RootPreference;
34 | 	IndividualPreferenceForm *ret = new IndividualPreferenceForm();
35 | 	ret->autorelease();
36 | 	ret->initFromFile(FileName_NaviBar, FileName_Body, nullptr);
37 | 	PrefListSize = ret->PrefList->getContentSize();
38 | 	ret->initPref(config);
39 | 	ret->setOnExitCallback(std::bind(&IndividualConfigManager::SaveToFile, IndividualConfigManager::GetInstance()));
40 | 	return ret;
41 | }
42 | 


--------------------------------------------------------------------------------
/src/core/environ/ui/IndividualPreferenceForm.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "PreferenceForm.h"
3 | 
4 | class IndividualPreferenceForm : public TVPPreferenceForm {
5 | public:
6 | 	static IndividualPreferenceForm *create(const tPreferenceScreen *config = nullptr);
7 | };


--------------------------------------------------------------------------------
/src/core/environ/ui/SeletListForm.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include "BaseForm.h"
 3 | #include "extension/UIExtension.h"
 4 | 
 5 | class iTVPHalfScreenForm : public iTVPBaseForm {
 6 | public:
 7 | 	virtual void rearrangeLayout() override;
 8 | };
 9 | 
10 | class TVPSelectListForm : public iTVPHalfScreenForm {
11 | public:
12 | 	static TVPSelectListForm *create(const std::vector<std::string> &info,
13 | 		const std::string &highlight_tid, const std::function<void(int)> &funcok);
14 | 
15 | protected:
16 | 	virtual void bindBodyController(const NodeMap &allNodes) override;
17 | 	void initWithInfo(const std::vector<std::string> &info, const std::string &highlight_tid);
18 | 
19 | 	std::function<void(int)> FuncOK;
20 | 
21 | 	XKPageView *pageView;
22 | };
23 | 
24 | class TVPTextPairInputForm : public iTVPHalfScreenForm {
25 | public:
26 | 	static TVPTextPairInputForm *create(const std::string &text1,
27 | 		const std::string &text2, const std::function<void(const std::string &, const std::string &)> &funcok);
28 | 
29 | private:
30 | 	virtual void bindBodyController(const NodeMap &allNodes) override;
31 | 	void initWithInfo(const std::string &text1, const std::string &text2);
32 | 
33 | 	std::function<void(const std::string &, const std::string &)> FuncOK;
34 | 
35 | 	cocos2d::ui::TextField *input1, *input2;
36 | };
37 | 
38 | class TVPKeyPairSelectForm : public TVPSelectListForm {
39 | 	typedef TVPSelectListForm inherit;
40 | 
41 | 	cocos2d::EventListenerKeyboard* _keylistener = nullptr;
42 | 	std::vector<std::string> _keyinfo;
43 | 	std::function<void(int)> _funcok;
44 | 
45 | public:
46 | 	static TVPKeyPairSelectForm *create(const std::function<void(int/*keycode*/)> &funcok);
47 | 
48 | 	virtual ~TVPKeyPairSelectForm();
49 | 
50 | 	void initWithInfo();
51 | 
52 | 	void onKeyPressed(cocos2d::EventKeyboard::KeyCode keyCode, cocos2d::Event* event);
53 | 	void onKeyReleased(cocos2d::EventKeyboard::KeyCode keyCode, cocos2d::Event* event);
54 | };


--------------------------------------------------------------------------------
/src/core/environ/ui/SimpleMediaFilePlayer.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include "BaseForm.h"
 3 | #include "tjsCommHead.h"
 4 | #include "movie/ffmpeg/VideoPlayer.h"
 5 | 
 6 | namespace cocos2d {
 7 | 	class Sprite;
 8 | }
 9 | 
10 | class SimplePlayerOverlay;
11 | 
12 | class SimpleMediaFilePlayer : public iTVPBaseForm {
13 | 	typedef cocos2d::Node inherit;
14 | 
15 | public:
16 | 	virtual ~SimpleMediaFilePlayer();
17 | 	static SimpleMediaFilePlayer *create();
18 | 
19 | 	void PlayFile(ttstr uri);
20 | 
21 | 	void Play();
22 | 	void Pause();
23 | 	void TooglePlayOrPause();
24 | 
25 | private:
26 | 	SimpleMediaFilePlayer();
27 | 	void onPlayerEvent(KRMovieEvent Msg, void* p);
28 | 	void onSliderChanged();
29 | 	virtual void rearrangeLayout() override;
30 | 	virtual void bindBodyController(const NodeMap &allNodes);
31 | 	virtual void bindFooterController(const NodeMap &allNodes);
32 | 	virtual void bindHeaderController(const NodeMap &allNodes);
33 | 
34 | 	virtual void update(float dt) override;
35 | 
36 | 	SimplePlayerOverlay *_player;
37 | 	int _totalTime; // in sec
38 | 	float hideRemain = 0;
39 | 	bool _inupdate = false;
40 | 
41 | 	// ui controllers
42 | 	cocos2d::ui::Text *Title, *PlayTime, *RemainTime, *OSDText;
43 | 	cocos2d::ui::Slider *Timeline;
44 | 	cocos2d::Node *NaviBar, *ControlBar, *OSD, *Overlay;
45 | 	cocos2d::ui::Widget *PlayBtn;
46 | 	cocos2d::Node *PlayBtnNormal, *PlayBtnPress, *PlayIconNormal, *PlayIconPress, *PauseIconNormal, *PauseIconPress;
47 | 	void setPlayButtonHighlight(bool highlight);
48 | 	void refreshPlayButtonStatus();
49 | };
50 | 


--------------------------------------------------------------------------------
/src/core/environ/ui/TipsHelpForm.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include "BaseForm.h"
 3 | 
 4 | class TVPTipsHelpForm : public iTVPBaseForm {
 5 | 	virtual void bindBodyController(const NodeMap &allNodes) override;
 6 | 	cocos2d::ui::ListView *_tipslist;
 7 | 
 8 | public:
 9 | 	static TVPTipsHelpForm* create();
10 | 	static TVPTipsHelpForm* show(const char *tipName = nullptr);
11 | 
12 | 	void setOneTip(const std::string &tipName);
13 | 	virtual void rearrangeLayout() override;
14 | };


--------------------------------------------------------------------------------
/src/core/environ/ui/XP3RepackForm.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include <string>
3 | 
4 | void TVPProcessXP3Repack(const std::string &dir);
5 | 


--------------------------------------------------------------------------------
/src/core/environ/ui/extension/ActionExtension.cpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "cocos2d.h"
3 | #include "cocos-ext.h"
4 | 
5 | 


--------------------------------------------------------------------------------
/src/core/environ/ui/extension/ActionExtension.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "cocos2d.h"
3 | #include "cocos-ext.h"
4 | 
5 | 


--------------------------------------------------------------------------------
/src/core/environ/ui/extension/UIExtension.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/environ/ui/extension/UIExtension.cpp


--------------------------------------------------------------------------------
/src/core/environ/ui/extension/UIExtension.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include "extensions/GUI/CCScrollView/CCScrollView.h"
 3 | 
 4 | class XKPageView;
 5 | class XKPageViewDelegate
 6 | {
 7 | public:
 8 | 	virtual ~XKPageViewDelegate(){};
 9 | 	XKPageViewDelegate(){};
10 | 	virtual cocos2d::Size sizeForPerPage() = 0;
11 | 	virtual void pageViewDidScroll(XKPageView *pageView){};
12 | };
13 | 
14 | class XKPageView : public cocos2d::extension::ScrollView
15 | {
16 | public:
17 | 	static XKPageView *create(cocos2d::Size size, XKPageViewDelegate *delegate);
18 | 	virtual bool init(cocos2d::Size size, XKPageViewDelegate *delegate);
19 | 	ssize_t getCurPageIndex() const { return current_index; }
20 | 	void setCurPageIndex(ssize_t idx);
21 | 	ssize_t getPageCount() const { return pageCount; }
22 | public:
23 | 	void setPageSize(const cocos2d::Size &size) { pageSize = size; }
24 | 	virtual void setContentOffsetInDuration(cocos2d::Vec2 offset, float dt);
25 | 	virtual void setContentOffset(cocos2d::Vec2 offset);
26 | 	void setTouchEnabled(bool enabled);
27 | 
28 | private:
29 | 	virtual bool onTouchBegan(cocos2d::Touch *touch, cocos2d::Event *unusedEvent) override;
30 | 	virtual void onTouchMoved(cocos2d::Touch *touch, cocos2d::Event *unusedEvent) override;
31 | 	virtual void onTouchEnded(cocos2d::Touch *touch, cocos2d::Event *unusedEvent) override;
32 | 
33 | 	void performedAnimatedScroll(float dt);
34 | 	int current_index;
35 | 	float current_offset;
36 | 
37 | 	void adjust(float offset);
38 | 	cocos2d::Size pageSize;
39 | 	CC_SYNTHESIZE(XKPageViewDelegate *, _delegate, Delegate);
40 | public:
41 | 	int pageCount;
42 | 	void addPage(Node *node);
43 | 	cocos2d::Node *getPageAtIndex(int index);
44 | };
45 | 
46 | void TVPInitUIExtension();


--------------------------------------------------------------------------------
/src/core/environ/win32/CompatibleNativeFuncs.cpp:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // native functions support
10 | //---------------------------------------------------------------------------
11 | 
12 | #include "tjsCommHead.h"
13 | 
14 | 
15 | #define TVP_WNF_A
16 | #include "CompatibleNativeFuncs.h"
17 | #undef TVP_WNF_A
18 | 
19 | #undef CompatibleNativeFuncsH
20 | 
21 | #define TVP_WNF_B
22 | #include "CompatibleNativeFuncs.h"
23 | #undef TVP_WNF_B
24 | 
25 | //---------------------------------------------------------------------------
26 | // TVPInitCompatibleNativeFunctions
27 | //---------------------------------------------------------------------------
28 | void TVPInitCompatibleNativeFunctions()
29 | {
30 | 	// retrieve function pointer from each module
31 | 	const tjs_int n = sizeof(TVPCompatibleNativeFuncs)/sizeof(tTVPCompatibleNativeFunc);
32 | 	for( tjs_int i = 0; i<n; i++ ) 	{
33 | 		tTVPCompatibleNativeFunc * p = TVPCompatibleNativeFuncs + i;
34 | 		HMODULE module = GetModuleHandle(p->Module);
35 | 		if(module) *(p->Ptr) = (void*)GetProcAddress(module, p->Name);
36 | 	}
37 | }
38 | //---------------------------------------------------------------------------
39 | 


--------------------------------------------------------------------------------
/src/core/environ/win32/ConfigFormUnit.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/environ/win32/ConfigFormUnit.cpp


--------------------------------------------------------------------------------
/src/core/environ/win32/ConfigFormUnit.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | // Config dialog box
 3 | //---------------------------------------------------------------------------
 4 | 
 5 | #ifndef ConfigFormUnitH
 6 | #define ConfigFormUnitH
 7 | 
 8 | extern void TVPShowUserConfig();
 9 | //---------------------------------------------------------------------------
10 | 
11 | #endif
12 | 
13 | 


--------------------------------------------------------------------------------
/src/core/environ/win32/DetectCPU.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/environ/win32/DetectCPU.cpp


--------------------------------------------------------------------------------
/src/core/environ/win32/DetectCPU.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // CPU idetification / features detection routine
10 | //---------------------------------------------------------------------------
11 | #ifndef DetectCPUH
12 | #define DetectCPUH
13 | //---------------------------------------------------------------------------
14 | extern "C"
15 | {
16 | 	extern tjs_uint32 TVPCPUType;
17 | }
18 | 
19 | extern void TVPDetectCPU();
20 | TJS_EXP_FUNC_DEF(tjs_uint32, TVPGetCPUType, ());
21 | 
22 | //---------------------------------------------------------------------------
23 | #endif
24 | 


--------------------------------------------------------------------------------
/src/core/environ/win32/EmergencyExit.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // Emergency Exit Hotkey Handler
10 | //---------------------------------------------------------------------------
11 | #ifndef EmergencyExitH
12 | #define EmergencyExitH
13 | 
14 | extern double TVPCPUClock;
15 | enum tTVPCPUClockAccuracy { ccaNotSet, ccaRough, ccaAccurate };
16 | extern tTVPCPUClockAccuracy TVPCPUClockAccuracy;
17 | //---------------------------------------------------------------------------
18 | #endif
19 | 


--------------------------------------------------------------------------------
/src/core/environ/win32/ImeControl.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/environ/win32/ImeControl.h


--------------------------------------------------------------------------------
/src/core/environ/win32/MainFormUnit.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/environ/win32/MainFormUnit.h


--------------------------------------------------------------------------------
/src/core/environ/win32/MouseCursor.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/environ/win32/MouseCursor.cpp


--------------------------------------------------------------------------------
/src/core/environ/win32/MouseCursor.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/environ/win32/MouseCursor.h


--------------------------------------------------------------------------------
/src/core/environ/win32/SystemControl.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/environ/win32/SystemControl.h


--------------------------------------------------------------------------------
/src/core/environ/win32/TVPWindow.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/environ/win32/TVPWindow.cpp


--------------------------------------------------------------------------------
/src/core/environ/win32/TVPWindow.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/environ/win32/TVPWindow.h


--------------------------------------------------------------------------------
/src/core/environ/win32/TouchPoint.cpp:
--------------------------------------------------------------------------------
1 | 
2 | #include "tjsCommHead.h"
3 | #include "TouchPoint.h"
4 | 
5 | const double TouchPointList::SCALE_THRESHOLD = 5;
6 | const double TouchPointList::ROTATE_THRESHOLD = 5;
7 | 
8 | 


--------------------------------------------------------------------------------
/src/core/environ/win32/TouchPoint.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/environ/win32/TouchPoint.h


--------------------------------------------------------------------------------
/src/core/environ/win32/VersionFormUnit.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/environ/win32/VersionFormUnit.cpp


--------------------------------------------------------------------------------
/src/core/environ/win32/VersionFormUnit.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // Version information dialog box
10 | //---------------------------------------------------------------------------
11 | 
12 | #ifndef VersionFormUnitH
13 | #define VersionFormUnitH
14 | 
15 | extern void TVPShowVersionForm();
16 | //---------------------------------------------------------------------------
17 | 
18 | #endif
19 | 


--------------------------------------------------------------------------------
/src/core/environ/win32/WindowFormUnit.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/environ/win32/WindowFormUnit.cpp


--------------------------------------------------------------------------------
/src/core/environ/win32/WindowsUtil.cpp:
--------------------------------------------------------------------------------
 1 | 
 2 | #include "tjsCommHead.h"
 3 | 
 4 | #include "tjsError.h"
 5 | #include "Application.h"
 6 | #include "DebugIntf.h"
 7 | #include "WindowsUtil.h"
 8 | 
 9 | void TVPThrowWindowsErrorException() {
10 | 	ttstr mes;
11 | 	LPVOID lpMsgBuf;
12 | 	::FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
13 | 		NULL, ::GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&lpMsgBuf, 0, NULL );
14 | 	mes = ttstr( (LPCWSTR)lpMsgBuf );
15 | 	::LocalFree(lpMsgBuf);
16 | 	throw new TJS::eTJSError( mes );
17 | }
18 | 
19 | void TVPOutputWindowsErrorToDebugMessage() {
20 | 	LPVOID lpMsgBuf;
21 | 	::FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
22 | 		NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&lpMsgBuf, 0, NULL );
23 | 	::OutputDebugString( (LPCWSTR)lpMsgBuf );
24 | 	::LocalFree(lpMsgBuf);
25 | }
26 | 
27 | void TVPOutputWindowsErrorToConsole( const char* file, int line ) {
28 | 	LPVOID lpMsgBuf;
29 | 	DWORD len = ::FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
30 | 		NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&lpMsgBuf, 0, NULL );
31 | 	if( len > 0 ) {
32 | #ifdef _DEBUG
33 | 		ttstr str(ttstr(L"(error) Windows Error : ") + ttstr(L"file : ") + ttstr(file) + ttstr(L", line : ") + ttstr(line) + ttstr(L", message : ") + ttstr((LPCWSTR)lpMsgBuf));
34 | #else
35 | 		ttstr str(ttstr(L"(error) Windows Error : ") + ttstr((LPCWSTR)lpMsgBuf));
36 | #endif
37 | 		TVPAddImportantLog( str );
38 | 	}
39 | 	::LocalFree(lpMsgBuf);
40 | }
41 | 
42 | 


--------------------------------------------------------------------------------
/src/core/environ/win32/WindowsUtil.h:
--------------------------------------------------------------------------------
 1 | 
 2 | #ifndef __WINDOWS_ERROR_EXCEPTION_H__
 3 | #define __WINDOWS_ERROR_EXCEPTION_H__
 4 | 
 5 | extern void TVPThrowWindowsErrorException();
 6 | extern void TVPOutputWindowsErrorToDebugMessage();
 7 | extern void TVPOutputWindowsErrorToConsole( const char* file=NULL, int line=0 );
 8 | 
 9 | #define TVP_WINDOWS_ERROR_LOG TVPOutputWindowsErrorToConsole( __FILE__, __LINE__ );
10 | 
11 | #endif	// __WINDOWS_ERROR_EXCEPTION_H__
12 | 


--------------------------------------------------------------------------------
/src/core/environ/win32/config.h:
--------------------------------------------------------------------------------
1 | #ifndef __ConfigH
2 | #define __ConfigH
3 | 
4 | 
5 | #endif
6 | 
7 | 


--------------------------------------------------------------------------------
/src/core/environ/win32/my_HintWindow.cpp:
--------------------------------------------------------------------------------
1 | #include "tjsCommHead.h"
2 | #include "HintWindow.h"
3 | HDWP TVPShowHintWindowTop(HDWP hdwp)
4 | {
5 | 	return NULL;
6 | }
7 | 


--------------------------------------------------------------------------------
/src/core/environ/win32type.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #if 0
 3 | typedef long HRESULT;
 4 | typedef void* HANDLE;
 5 | typedef HANDLE HWND;
 6 | 
 7 | typedef struct tagRGBQUAD {
 8 | 	uint8_t    rgbBlue;
 9 | 	uint8_t    rgbGreen;
10 | 	uint8_t    rgbRed;
11 | 	uint8_t    rgbReserved;
12 | } RGBQUAD;
13 | 
14 | typedef struct BITMAPINFOHEADER{
15 | 	uint32_t biSize;
16 | 	int32_t            biWidth;
17 | 	int32_t            biHeight;
18 | 	uint16_t  biPlanes;
19 | 	uint16_t  biBitCount;
20 | 	uint32_t   biCompression;
21 | 	uint32_t   biSizeImage;
22 | 	int32_t            biXPelsPerMeter;
23 | 	int32_t            biYPelsPerMeter;
24 | 	uint32_t   biClrUsed;
25 | 	uint32_t   biClrImportant;
26 | } *LPBITMAPINFOHEADER, *PBITMAPINFOHEADER;
27 | 
28 | typedef struct BITMAPINFO {
29 | 	BITMAPINFOHEADER    bmiHeader;
30 | 	RGBQUAD             bmiColors[1];
31 | } *LPBITMAPINFO, *PBITMAPINFO;
32 | 
33 | typedef struct {
34 | 	int	left;
35 | 	int	top;
36 | 	int	right;
37 | 	int	bottom;
38 | } RECT, RECTL;
39 | #endif


--------------------------------------------------------------------------------
/src/core/extension/Extension.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/extension/Extension.cpp


--------------------------------------------------------------------------------
/src/core/extension/Extension.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/extension/Extension.h


--------------------------------------------------------------------------------
/src/core/movie/ffmpeg/AEAudioFormat.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include "AEChannelInfo.h"
 3 | #include "AEStreamInfo.h"
 4 | 
 5 | #define AE_IS_PLANAR(x) ((x) >= AE_FMT_U8P && (x) <= AE_FMT_FLOATP)
 6 | 
 7 | NS_KRMOVIE_BEGIN
 8 | /**
 9 |  * The audio format structure that fully defines a stream's audio information
10 |  */
11 | struct AEAudioFormat
12 | {
13 |   /**
14 |    * The stream's data format (eg, AE_FMT_S16LE)
15 |    */
16 |   enum AEDataFormat m_dataFormat;
17 | 
18 |   /**
19 |    * The stream's sample rate (eg, 48000)
20 |    */
21 |   unsigned int m_sampleRate;
22 | 
23 |   /**
24 |    * The stream's channel layout
25 |    */
26 |   CAEChannelInfo m_channelLayout;
27 | 
28 |   /**
29 |    * The number of frames per period
30 |    */
31 |   unsigned int m_frames;
32 | 
33 |   /**
34 |    * The size of one frame in bytes
35 |    */
36 |   unsigned int m_frameSize;
37 | 
38 |   /**
39 |    * Stream info of raw passthrough
40 |    */
41 |   CAEStreamInfo m_streamInfo;
42 | 
43 |   AEAudioFormat()
44 |   {
45 |     m_dataFormat = AE_FMT_INVALID;
46 |     m_sampleRate = 0;
47 |     m_frames = 0;
48 |     m_frameSize = 0;
49 |   }
50 | 
51 |   bool operator==(const AEAudioFormat& fmt) const
52 |   {
53 |     return  m_dataFormat    ==  fmt.m_dataFormat    &&
54 |             m_sampleRate    ==  fmt.m_sampleRate    &&
55 |             m_channelLayout ==  fmt.m_channelLayout &&
56 |             m_frames        ==  fmt.m_frames        &&
57 |             m_frameSize     ==  fmt.m_frameSize     &&
58 |             m_streamInfo    ==  fmt.m_streamInfo;
59 |   }
60 |  
61 |   AEAudioFormat& operator=(const AEAudioFormat& fmt)
62 |   {
63 |     m_dataFormat = fmt.m_dataFormat;
64 |     m_sampleRate = fmt.m_sampleRate;
65 |     m_channelLayout = fmt.m_channelLayout;
66 |     m_frames = fmt.m_frames;
67 |     m_frameSize = fmt.m_frameSize;
68 |     m_streamInfo = fmt.m_streamInfo;
69 | 
70 |     return *this;
71 |   }
72 | };
73 | 
74 | NS_KRMOVIE_END


--------------------------------------------------------------------------------
/src/core/movie/ffmpeg/AEChannelInfo.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | 
 3 | #include <stdint.h>
 4 | #include <vector>
 5 | #include <string>
 6 | 
 7 | #include "AEChannelData.h"
 8 | 
 9 | NS_KRMOVIE_BEGIN
10 | class CHelper_libKODI_audioengine;
11 | 
12 | class CAEChannelInfo {
13 |   friend class CHelper_libKODI_audioengine;
14 | 
15 | public:
16 |   CAEChannelInfo();
17 |   CAEChannelInfo(const enum AEChannel* rhs);
18 |   CAEChannelInfo(const enum AEStdChLayout rhs);
19 |   ~CAEChannelInfo();
20 |   CAEChannelInfo& operator=(const CAEChannelInfo& rhs);
21 |   CAEChannelInfo& operator=(const enum AEChannel* rhs);
22 |   CAEChannelInfo& operator=(const enum AEStdChLayout rhs);
23 |   bool operator==(const CAEChannelInfo& rhs) const;
24 |   bool operator!=(const CAEChannelInfo& rhs) const;
25 |   CAEChannelInfo& operator+=(const enum AEChannel& rhs);
26 |   CAEChannelInfo& operator-=(const enum AEChannel& rhs);
27 |   const enum AEChannel operator[](unsigned int i) const;
28 |   operator std::string() const;
29 | 
30 |   /* remove any channels that dont exist in the provided info */
31 |   void ResolveChannels(const CAEChannelInfo& rhs);
32 |   void Reset();
33 |   inline unsigned int Count() const { return m_channelCount; }
34 |   static const char* GetChName(const enum AEChannel ch);
35 |   bool HasChannel(const enum AEChannel ch) const;
36 |   bool ContainsChannels(const CAEChannelInfo& rhs) const;
37 |   void ReplaceChannel(const enum AEChannel from, const enum AEChannel to);
38 |   int BestMatch(const std::vector<CAEChannelInfo>& dsts, int* score = NULL) const;
39 |   void AddMissingChannels(const CAEChannelInfo& rhs);
40 | 
41 | private:
42 |   unsigned int   m_channelCount;
43 |   enum AEChannel m_channels[AE_CH_MAX];
44 | };
45 | 
46 | NS_KRMOVIE_END


--------------------------------------------------------------------------------
/src/core/movie/ffmpeg/AEFactory.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include <utility>
 3 | #include <vector>
 4 | #include "AE.h"
 5 | 
 6 | NS_KRMOVIE_BEGIN
 7 | class CSetting;
 8 | class CAEStreamInfo;
 9 | 
10 | class CAEFactory
11 | {
12 | public:
13 |   static bool SupportsRaw(AEAudioFormat &format);
14 |   static IAEStream *MakeStream(AEAudioFormat &audioFormat, unsigned int options = 0, IAEClockCallback *clock = NULL);
15 |   static bool FreeStream(IAEStream *stream);
16 | private:
17 |   static IAE *AE;
18 | 
19 |   static void SettingOptionsAudioDevicesFillerGeneral(const CSetting *setting, std::vector< std::pair<std::string, std::string> > &list, std::string &current, bool passthrough);
20 | };
21 | 
22 | NS_KRMOVIE_END


--------------------------------------------------------------------------------
/src/core/movie/ffmpeg/AEStreamData.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include "KRMovieDef.h"
 3 | NS_KRMOVIE_BEGIN
 4 | /**
 5 |  * Bit options to pass to IAE::MakeStream
 6 |  */
 7 | enum AEStreamOptions
 8 | {
 9 |   AESTREAM_FORCE_RESAMPLE = 1 << 0,   /* force resample even if rates match */
10 |   AESTREAM_PAUSED         = 1 << 1,   /* create the stream paused */
11 |   AESTREAM_AUTOSTART      = 1 << 2,   /* autostart the stream when enough data is buffered */
12 |   AESTREAM_BYPASS_ADSP    = 1 << 3    /* if this option is set the ADSP-System is bypassed and the raw stream will be passed through IAESink */
13 | };
14 | NS_KRMOVIE_END


--------------------------------------------------------------------------------
/src/core/movie/ffmpeg/AudioCodecFFmpeg.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include "KRMovieDef.h"
 3 | #include "AudioCodec.h"
 4 | 
 5 | extern "C" {
 6 | #include "libavcodec/avcodec.h"
 7 | #include "libavformat/avformat.h"
 8 | #include "libavutil/avutil.h"
 9 | #include "libswresample/swresample.h"
10 | }
11 | 
12 | NS_KRMOVIE_BEGIN
13 | class CProcessInfo;
14 | 
15 | class CDVDAudioCodecFFmpeg : public CDVDAudioCodec
16 | {
17 | public:
18 |   CDVDAudioCodecFFmpeg(CProcessInfo &processInfo);
19 |   virtual ~CDVDAudioCodecFFmpeg();
20 |   virtual bool Open(CDVDStreamInfo &hints, CDVDCodecOptions &options);
21 |   virtual void Dispose();
22 |   virtual int Decode(uint8_t* pData, int iSize, double dts, double pts);
23 |   virtual void GetData(DVDAudioFrame &frame);
24 |   virtual int GetData(uint8_t** dst);
25 |   virtual void Reset();
26 |   virtual AEAudioFormat GetFormat() { return m_format; }
27 |   virtual const char* GetName() { return "FFmpeg"; }
28 |   virtual enum AVMatrixEncoding GetMatrixEncoding();
29 |   virtual enum AVAudioServiceType GetAudioServiceType();
30 |   virtual int GetProfile();
31 | 
32 | protected:
33 |   enum AEDataFormat GetDataFormat();
34 |   int GetSampleRate();
35 |   int GetChannels();
36 |   CAEChannelInfo GetChannelMap();
37 |   int GetBitRate();
38 | 
39 |   AEAudioFormat m_format;
40 |   AVCodecContext* m_pCodecContext;
41 |   enum AVSampleFormat m_iSampleFormat;
42 |   CAEChannelInfo m_channelLayout;
43 |   enum AVMatrixEncoding m_matrixEncoding;
44 | 
45 |   AVFrame* m_pFrame1;
46 |   int m_gotFrame;
47 | 
48 |   int m_channels;
49 |   uint64_t m_layout;
50 | 
51 |   void BuildChannelMap();
52 |   void ConvertToFloat();
53 | };
54 | 
55 | NS_KRMOVIE_END


--------------------------------------------------------------------------------
/src/core/movie/ffmpeg/AudioCodecPassthrough.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include "AudioCodec.h"
 3 | #include "AEAudioFormat.h"
 4 | #include "AEStreamInfo.h"
 5 | #include <memory>
 6 | NS_KRMOVIE_BEGIN
 7 | class CProcessInfo;
 8 | 
 9 | class CDVDAudioCodecPassthrough : public CDVDAudioCodec
10 | {
11 | public:
12 |   CDVDAudioCodecPassthrough(CProcessInfo &processInfo);
13 |   virtual ~CDVDAudioCodecPassthrough();
14 | 
15 |   virtual bool Open(CDVDStreamInfo &hints, CDVDCodecOptions &options);
16 |   virtual void Dispose();
17 |   virtual int Decode(uint8_t* pData, int iSize, double dts, double pts);
18 |   virtual void GetData(DVDAudioFrame &frame);
19 |   virtual int GetData(uint8_t** dst);
20 |   virtual void Reset();
21 |   virtual AEAudioFormat GetFormat() { return m_format; }
22 |   virtual bool NeedPassthrough() { return true; }
23 |   virtual const char* GetName() { return "passthrough"; }
24 |   virtual int GetBufferSize();
25 | private:
26 |   CAEStreamParser m_parser;
27 |   uint8_t* m_buffer;
28 |   unsigned int m_bufferSize;
29 |   unsigned int m_dataSize;
30 |   AEAudioFormat m_format;
31 |   uint8_t m_backlogBuffer[61440];
32 |   unsigned int m_backlogSize;
33 |   double m_currentPts;
34 |   double m_nextPts;
35 | 
36 |   // TrueHD specifics
37 |   std::unique_ptr<uint8_t[]> m_trueHDBuffer;
38 |   unsigned int m_trueHDoffset;
39 | };
40 | 
41 | NS_KRMOVIE_END


--------------------------------------------------------------------------------
/src/core/movie/ffmpeg/AudioDevice.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #if (defined HAVE_CONFIG_H) && (!defined TARGET_WINDOWS)
 3 |   #include "config.h"
 4 | #endif
 5 | #include "AEChannelInfo.h"
 6 | #include "AEStream.h"
 7 | #include "Thread.h"
 8 | 
 9 | extern "C" {
10 | #include "libavcodec/avcodec.h"
11 | }
12 | 
13 | NS_KRMOVIE_BEGIN
14 | 
15 | typedef struct stDVDAudioFrame DVDAudioFrame;
16 | 
17 | class CDVDClock;
18 | 
19 | class CDVDAudio : IAEClockCallback
20 | {
21 | public:
22 |   CDVDAudio(CDVDClock *clock);
23 |   ~CDVDAudio();
24 | 
25 |  // void SetVolume(float fVolume);
26 |  // void SetDynamicRangeCompression(long drc);
27 |  // float GetCurrentAttenuation();
28 |   void Pause();
29 |   void Resume();
30 |   bool Create(const DVDAudioFrame &audioframe, AVCodecID codec, bool needresampler);
31 |   bool IsValidFormat(const DVDAudioFrame &audioframe);
32 |   void Destroy();
33 |   unsigned int AddPackets(const DVDAudioFrame &audioframe);
34 |   double GetPlayingPts();
35 |   double GetCacheTime();
36 |   double GetCacheTotal(); // returns total amount the audio device can buffer
37 |   double GetDelay(); // returns the time it takes to play a packet if we add one at this time
38 |   double GetSyncError();
39 |   void SetSyncErrorCorrection(double correction);
40 |   double GetResampleRatio();
41 |   void SetResampleMode(int mode);
42 |   void Flush();
43 |   void Drain();
44 |   void AbortAddPackets();
45 | 
46 |   double GetClock();
47 |   double GetClockSpeed();
48 |   IAEStream *m_pAudioStream;
49 | 
50 | protected:
51 | 
52 |   double m_playingPts;
53 |   double m_timeOfPts;
54 |   double m_syncError;
55 |   unsigned int m_syncErrorTime;
56 |   double m_resampleRatio;
57 |   std::recursive_mutex m_critSection;
58 | 
59 |   unsigned int m_sampeRate;
60 |   int m_iBitsPerSample;
61 |   bool m_bPassthrough;
62 |   CAEChannelInfo m_channelLayout;
63 |   bool m_bPaused;
64 | 
65 |   std::atomic_bool m_bAbort;
66 |   CDVDClock *m_pClock;
67 | };
68 | NS_KRMOVIE_END


--------------------------------------------------------------------------------
/src/core/movie/ffmpeg/BitstreamStats.cpp:
--------------------------------------------------------------------------------
 1 | #include "BitstreamStats.h"
 2 | #include "TimeUtils.h"
 3 | 
 4 | NS_KRMOVIE_BEGIN
 5 | int64_t BitstreamStats::m_tmFreq;
 6 | 
 7 | BitstreamStats::BitstreamStats(unsigned int nEstimatedBitrate)
 8 | {
 9 |   m_dBitrate = 0.0;
10 |   m_dMaxBitrate = 0.0;
11 |   m_dMinBitrate = -1.0;
12 | 
13 |   m_nBitCount = 0;
14 |   m_nEstimatedBitrate = nEstimatedBitrate;
15 |   m_tmStart = 0LL;
16 | 
17 |   if (m_tmFreq == 0LL)
18 |     m_tmFreq = CurrentHostFrequency();
19 | }
20 | 
21 | BitstreamStats::~BitstreamStats()
22 | {
23 | }
24 | 
25 | void BitstreamStats::AddSampleBytes(unsigned int nBytes)
26 | {
27 |   AddSampleBits(nBytes*8);
28 | }
29 | 
30 | void BitstreamStats::AddSampleBits(unsigned int nBits)
31 | {
32 |   m_nBitCount += nBits;
33 |   if (m_nBitCount >= m_nEstimatedBitrate)
34 |     CalculateBitrate();
35 | }
36 | 
37 | void BitstreamStats::Start()
38 | {
39 |   m_nBitCount = 0;
40 |   m_tmStart = CurrentHostCounter();
41 | }
42 | 
43 | void BitstreamStats::CalculateBitrate()
44 | {
45 |   int64_t tmNow;
46 |   tmNow = CurrentHostCounter();
47 | 
48 |   double elapsed = (double)(tmNow - m_tmStart) / (double)m_tmFreq;
49 |   // only update once every 2 seconds
50 |   if (elapsed >= 2)
51 |   {
52 |     m_dBitrate = (double)m_nBitCount / elapsed;
53 | 
54 |     if (m_dBitrate > m_dMaxBitrate)
55 |       m_dMaxBitrate = m_dBitrate;
56 | 
57 |     if (m_dBitrate < m_dMinBitrate || m_dMinBitrate == -1)
58 |       m_dMinBitrate = m_dBitrate;
59 | 
60 |     Start();
61 |   }
62 | }
63 | 
64 | 
65 | 
66 | 
67 | NS_KRMOVIE_END


--------------------------------------------------------------------------------
/src/core/movie/ffmpeg/BitstreamStats.h:
--------------------------------------------------------------------------------
 1 | #ifndef BITSTREAM_STATS__H__
 2 | #define BITSTREAM_STATS__H__
 3 | #include "KRMovieDef.h"
 4 | #include <string>
 5 | #ifdef TARGET_POSIX
 6 | #include "linux/PlatformDefs.h"
 7 | #else
 8 | #include <stdint.h>
 9 | #endif
10 | 
11 | NS_KRMOVIE_BEGIN
12 | class BitstreamStats
13 | {
14 | public:
15 |   // in order not to cause a performance hit, we should only check the clock when
16 |   // we reach m_nEstimatedBitrate bits.
17 |   // if this value is 1, we will calculate bitrate on every sample.
18 |   BitstreamStats(unsigned int nEstimatedBitrate=(10240*8) /*10Kbit*/);
19 |   virtual ~BitstreamStats();
20 | 
21 |   void AddSampleBytes(unsigned int nBytes);
22 |   void AddSampleBits(unsigned int nBits);
23 | 
24 |   inline double GetBitrate()    const { return m_dBitrate; }
25 |   inline double GetMaxBitrate() const { return m_dMaxBitrate; }
26 |   inline double GetMinBitrate() const { return m_dMinBitrate; }
27 | 
28 |   void Start();
29 |   void CalculateBitrate();
30 | 
31 | private:
32 |   double m_dBitrate;
33 |   double m_dMaxBitrate;
34 |   double m_dMinBitrate;
35 |   unsigned int m_nBitCount;
36 |   unsigned int m_nEstimatedBitrate; // when we reach this amount of bits we check current bitrate.
37 |   int64_t m_tmStart;
38 |   static int64_t m_tmFreq;
39 | };
40 | NS_KRMOVIE_END
41 | #endif
42 | 
43 | 


--------------------------------------------------------------------------------
/src/core/movie/ffmpeg/CodecUtils.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include "VideoCodec.h"
 3 | #include "RenderFormats.h"
 4 | 
 5 | extern "C" {
 6 | #include "libavutil/pixfmt.h"
 7 | }
 8 | 
 9 | NS_KRMOVIE_BEGIN
10 | struct YV12Image;
11 | 
12 | class CDVDCodecUtils
13 | {
14 | public:
15 |   static DVDVideoPicture* AllocatePicture(int iWidth, int iHeight);
16 |   static void FreePicture(DVDVideoPicture* pPicture);
17 |   static bool CopyPicture(DVDVideoPicture* pDst, DVDVideoPicture* pSrc);
18 |   static bool CopyPicture(YV12Image* pDst, DVDVideoPicture *pSrc);
19 |   
20 |   static DVDVideoPicture* ConvertToNV12Picture(DVDVideoPicture *pSrc);
21 |   static DVDVideoPicture* ConvertToYUV422PackedPicture(DVDVideoPicture *pSrc, ERenderFormat format);
22 |   static bool CopyNV12Picture(YV12Image* pImage, DVDVideoPicture *pSrc);
23 |   static bool CopyYUV422PackedPicture(YV12Image* pImage, DVDVideoPicture *pSrc);
24 | 
25 |   static bool IsVP3CompatibleWidth(int width);
26 | 
27 |   static double NormalizeFrameduration(double frameduration, bool *match = NULL);
28 | 
29 |   static ERenderFormat EFormatFromPixfmt(int fmt);
30 |   static AVPixelFormat PixfmtFromEFormat(ERenderFormat format);
31 | };
32 | 
33 | NS_KRMOVIE_END


--------------------------------------------------------------------------------
/src/core/movie/ffmpeg/Codecs.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include "KRMovieDef.h"
 3 | #if (defined HAVE_CONFIG_H) && (!defined TARGET_WINDOWS)
 4 |   #include "config.h"
 5 | #endif
 6 | 
 7 | #include "RenderFormats.h"
 8 | #include <string>
 9 | 
10 | NS_KRMOVIE_BEGIN
11 | // 0x100000 is the video starting range
12 | 
13 | // 0x200000 is the audio starting range
14 | 
15 | // special options that can be passed to a codec
16 | class CDVDCodecOption
17 | {
18 | public:
19 |   CDVDCodecOption(const std::string& name, const std::string& value) : m_name(name), m_value(value) {}
20 |   std::string m_name;
21 |   std::string m_value;
22 | };
23 | 
24 | class CDVDCodecOptions
25 | {
26 | public:
27 |   std::vector<CDVDCodecOption> m_keys;
28 |   std::vector<ERenderFormat> m_formats;
29 |   const void *m_opaque_pointer;
30 | };
31 | NS_KRMOVIE_END


--------------------------------------------------------------------------------
/src/core/movie/ffmpeg/Demux.cpp:
--------------------------------------------------------------------------------
 1 | #include "Demux.h"
 2 | 
 3 | NS_KRMOVIE_BEGIN
 4 | int64_t IDemux::NewGuid()
 5 | {
 6 | 	static int64_t guid = 0;
 7 | 	return guid++;
 8 | }
 9 | 
10 | std::string CDemuxStreamAudio::GetStreamType()
11 | {
12 | 	switch (iChannels) {
13 | 	case 1: return "Mono";
14 | 	case 2: return "Stereo";
15 | 	case 6: return "5.1";
16 | 	case 8: return "7.1";
17 | 	default: return "";
18 | 	}
19 | }
20 | 
21 | NS_KRMOVIE_END
22 | 


--------------------------------------------------------------------------------
/src/core/movie/ffmpeg/DemuxPacket.cpp:
--------------------------------------------------------------------------------
 1 | #include "DemuxPacket.h"
 2 | #include <memory>
 3 | #include "tp_stub.h"
 4 | #include "Clock.h"
 5 | extern "C" {
 6 | #include "libavcodec/avcodec.h"
 7 | }
 8 | 
 9 | NS_KRMOVIE_BEGIN
10 | void DemuxPacket::Free(DemuxPacket *pPacket)
11 | {
12 | 	if (pPacket)
13 | 	{
14 | 		try {
15 | 			if (pPacket->pData) TJSAlignedDealloc(pPacket->pData);
16 | 			delete pPacket;
17 | 		} catch (...) {
18 | //			CLog::Log(LOGERROR, "%s - Exception thrown while freeing packet", __FUNCTION__);
19 | 		}
20 | 	}
21 | }
22 | 
23 | DemuxPacket * DemuxPacket::Allocate(int iDataSize /*= 0*/)
24 | {
25 | 	DemuxPacket* pPacket = new DemuxPacket;
26 | 	if (!pPacket) return nullptr;
27 | 
28 | 	try
29 | 	{
30 | 		memset(pPacket, 0, sizeof(DemuxPacket));
31 | 
32 | 		if (iDataSize > 0)
33 | 		{
34 | 			// need to allocate a few bytes more.
35 | 			// From avcodec.h (ffmpeg)
36 | 			/**
37 | 			* Required number of additionally allocated bytes at the end of the input bitstream for decoding.
38 | 			* this is mainly needed because some optimized bitstream readers read
39 | 			* 32 or 64 bit at once and could read over the end<br>
40 | 			* Note, if the first 23 bits of the additional bytes are not 0 then damaged
41 | 			* MPEG bitstreams could cause overread and segfault
42 | 			*/
43 | 			pPacket->pData = (uint8_t*)TJSAlignedAlloc(iDataSize + FF_INPUT_BUFFER_PADDING_SIZE, 4);
44 | 			if (!pPacket->pData)
45 | 			{
46 | 				Free(pPacket);
47 | 				return NULL;
48 | 			}
49 | 
50 | 			// reset the last 8 bytes to 0;
51 | 			memset(pPacket->pData + iDataSize, 0, FF_INPUT_BUFFER_PADDING_SIZE);
52 | 		}
53 | 
54 | 		// setup defaults
55 | 		pPacket->dts = DVD_NOPTS_VALUE;
56 | 		pPacket->pts = DVD_NOPTS_VALUE;
57 | 		pPacket->iStreamId = -1;
58 | 		pPacket->dispTime = 0;
59 | 	} catch (...) {
60 | //		CLog::Log(LOGERROR, "%s - Exception thrown", __FUNCTION__);
61 | 		Free(pPacket);
62 | 		pPacket = nullptr;
63 | 	}
64 | 	return pPacket;
65 | }
66 | 
67 | NS_KRMOVIE_END
68 | 


--------------------------------------------------------------------------------
/src/core/movie/ffmpeg/DemuxPacket.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include "KRMovieDef.h"
 3 | #include <stdint.h>
 4 | 
 5 | NS_KRMOVIE_BEGIN
 6 | #define DMX_SPECIALID_STREAMINFO    -10
 7 | #define DMX_SPECIALID_STREAMCHANGE  -11
 8 | 
 9 | struct DemuxPacket
10 | {
11 | 	unsigned char* pData;   // data
12 | 	int iSize;     // data size
13 | 	int iStreamId; // integer representing the stream index
14 | 	int64_t demuxerId; // id of the demuxer that created the packet
15 | 	int iGroupId;  // the group this data belongs to, used to group data from different streams together
16 | 
17 | 	double pts; // pts in DVD_TIME_BASE
18 | 	double dts; // dts in DVD_TIME_BASE
19 | 	double duration; // duration in DVD_TIME_BASE if available
20 | 
21 | 	int dispTime;
22 | 
23 | 	static void Free(DemuxPacket *);
24 | 	static DemuxPacket *Allocate(int iDataSize = 0);
25 | };
26 | 
27 | NS_KRMOVIE_END
28 | 


--------------------------------------------------------------------------------
/src/core/movie/ffmpeg/FactoryCodec.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include <vector>
 3 | #include "ProcessInfo.h"
 4 | #include "RenderFormats.h"
 5 | 
 6 | NS_KRMOVIE_BEGIN
 7 | 
 8 | class CDVDVideoCodec;
 9 | class CDVDAudioCodec;
10 | class CDVDOverlayCodec;
11 | 
12 | class CDemuxStreamVideo;
13 | struct CDVDStreamInfo;
14 | class CDVDCodecOption;
15 | class CDVDCodecOptions;
16 | 
17 | 
18 | class CDVDFactoryCodec
19 | {
20 | public:
21 |   static CDVDVideoCodec* CreateVideoCodec(CDVDStreamInfo &hint,
22 |                                           CProcessInfo &processInfo,
23 |                                           const CRenderInfo &info = CRenderInfo());
24 |   static CDVDAudioCodec* CreateAudioCodec(CDVDStreamInfo &hint, CProcessInfo &processInfo,
25 |                                           bool allowpassthrough = true, bool allowdtshddecode = true);
26 | //  static CDVDOverlayCodec* CreateOverlayCodec(CDVDStreamInfo &hint );
27 | 
28 |   static CDVDAudioCodec* OpenCodec(CDVDAudioCodec* pCodec, CDVDStreamInfo &hint, CDVDCodecOptions &options );
29 |   static CDVDVideoCodec* OpenCodec(CDVDVideoCodec* pCodec, CDVDStreamInfo &hint, CDVDCodecOptions &options );
30 | //  static CDVDOverlayCodec* OpenCodec(CDVDOverlayCodec* pCodec, CDVDStreamInfo &hint, CDVDCodecOptions &options );
31 | };
32 | 
33 | NS_KRMOVIE_END


--------------------------------------------------------------------------------
/src/core/movie/ffmpeg/IAudioCallback.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include "KRMovieDef.h"
 3 | NS_KRMOVIE_BEGIN
 4 | class IAudioCallback
 5 | {
 6 | public:
 7 |   IAudioCallback() {};
 8 |   virtual ~IAudioCallback() {};
 9 |   virtual void OnInitialize(int iChannels, int iSamplesPerSec, int iBitsPerSample) = 0;
10 |   virtual void OnAudioData(const float* pAudioData, int iAudioDataLength) = 0;
11 | };
12 | 
13 | NS_KRMOVIE_END


--------------------------------------------------------------------------------
/src/core/movie/ffmpeg/InputStream.cpp:
--------------------------------------------------------------------------------
 1 | #include "InputStream.h"
 2 | #include "combase.h"
 3 | 
 4 | NS_KRMOVIE_BEGIN
 5 | InputStream::InputStream(IStream *s, const std::string &filename)
 6 | 	: m_pSource(s)
 7 | 	, m_strFileName(filename)
 8 | {
 9 | 	s->AddRef();
10 | 
11 | 	STATSTG stg;
12 | 	s->Stat(&stg, STATFLAG_NONAME);
13 | 	m_nFileSize = stg.cbSize.QuadPart;
14 | }
15 | 
16 | InputStream::~InputStream() {
17 | 	m_pSource->Release();
18 | }
19 | 
20 | int InputStream::Read(uint8_t* buf, int buf_size) {
21 | 	ULONG readed;
22 | 	HRESULT ret = m_pSource->Read(buf, buf_size, &readed);
23 | 	if (ret != S_OK) return -1;
24 | 	return readed;
25 | }
26 | 
27 | int64_t InputStream::Seek(int64_t offset, int whence) {
28 | 	LARGE_INTEGER pos; pos.QuadPart = offset;
29 | 	ULARGE_INTEGER newpos;
30 | 	HRESULT ret = m_pSource->Seek(pos, whence, &newpos);
31 | 	if (ret != S_OK) return -1;
32 | 	return newpos.QuadPart;
33 | }
34 | 
35 | NS_KRMOVIE_END


--------------------------------------------------------------------------------
/src/core/movie/ffmpeg/InputStream.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include "Ref.h"
 3 | #include <string>
 4 | #include <cstdint>
 5 | 
 6 | struct IStream;
 7 | 
 8 | NS_KRMOVIE_BEGIN
 9 | class InputStream : public IRef<InputStream> {
10 | 	IStream *m_pSource;
11 | 	uint64_t m_nFileSize;
12 | 	std::string m_strFileName;
13 | 
14 | public:
15 | 	InputStream(IStream *s, const std::string &filename);
16 | 	~InputStream();
17 | 
18 | 	uint64_t GetLength() { return m_nFileSize; }
19 | 	int Read(uint8_t* buf, int buf_size);
20 | 	int64_t Seek(int64_t offset, int whence);
21 | 	const std::string &GetFileName() { return m_strFileName; }
22 | };
23 | 
24 | NS_KRMOVIE_END


--------------------------------------------------------------------------------
/src/core/movie/ffmpeg/KRMovieDef.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #define NS_KRMOVIE_BEGIN namespace KRMovie {
 3 | #define NS_KRMOVIE_END }
 4 | 
 5 | #define SAFE_DELETE(p)       do { delete (p);     (p)=NULL; } while (0)
 6 | #define SAFE_RELEASE(p)      do { if(p) { (p)->Release(); (p)=NULL; } } while (0)
 7 | 
 8 | #ifdef _MSC_VER
 9 | #define NOMINMAX
10 | #endif


--------------------------------------------------------------------------------
/src/core/movie/ffmpeg/KRMovieLayer.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include "KRMoviePlayer.h"
 3 | #include "EventIntf.h"
 4 | 
 5 | NS_KRMOVIE_BEGIN
 6 | 
 7 | class VideoPresentLayer : public TVPMoviePlayer, public tTVPContinuousEventCallbackIntf {
 8 | protected:
 9 | 	tTVPBaseTexture *m_BmpBits[2];
10 | 	int             m_nCurBmpBuff = 0;
11 | 
12 | public:
13 | 	~VideoPresentLayer();
14 | 	virtual tTVPBaseTexture* GetFrontBuffer() override;
15 | 	virtual void SetVideoBuffer(tTVPBaseTexture *buff1, tTVPBaseTexture *buff2, long size) override;
16 | 
17 | 	virtual void OnContinuousCallback(tjs_uint64 tick) override;
18 | 	virtual void OnPlayEvent(KRMovieEvent msg, void *p) = 0;
19 | 	virtual int AddVideoPicture(DVDVideoPicture &pic, int index) override;
20 | };
21 | 
22 | class MoviePlayerLayer : public VideoPresentLayer {
23 | 	typedef VideoPresentLayer inherit;
24 | 	tTJSNI_VideoOverlay* m_pCallbackWin = nullptr;
25 | 
26 | public:
27 | 	void BuildGraph(tTJSNI_VideoOverlay* callbackwin, IStream *stream, const tjs_char * streamname, const tjs_char *type, uint64_t size);
28 | 	virtual void OnPlayEvent(KRMovieEvent msg, void *p) override;
29 | 	virtual void Play() override;
30 | };
31 | 
32 | NS_KRMOVIE_END


--------------------------------------------------------------------------------
/src/core/movie/ffmpeg/OptionInfo.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | // option information for kirikiri configurator
 3 | //---------------------------------------------------------------------------
 4 | 
 5 | #ifndef __OptionInfoH__
 6 | #define __OptionInfoH__
 7 | 
 8 | #include <windows.h>
 9 | #include "tp_stub.h"
10 | #include <tchar.h>
11 | 
12 | 
13 | //---------------------------------------------------------------------------
14 | // GetOptionInfoString: returns option information string for kirikiri conf.
15 | //---------------------------------------------------------------------------
16 | static inline const wchar_t * GetOptionInfoString()
17 | {
18 | 		return
19 | 		// for other languages; currently only English information is available.
20 | L"Debug:ROT registration;Whether to register into ROT(Running Object Table) when "
21 | L"playbacking movies. Choosing 'Yes' enables you to inspect the trouble related with movies, "
22 | L"using GraphEdit(available from DirectX SDK). 'Pause' not only enables ROT registeration, "
23 | L"but makes the program also displaying message-box (this interrupts the program and makes a pause) "
24 | L"after the graph is built.|"
25 | L"movie_reg_rot|select,*no;No,yes;Yes,pause;Pause\n";
26 | }
27 | 
28 | #endif
29 | 


--------------------------------------------------------------------------------
/src/core/movie/ffmpeg/Ref.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include "KRMovieDef.h"
 3 | #include <atomic>
 4 | #include <assert.h>
 5 | 
 6 | NS_KRMOVIE_BEGIN
 7 | 
 8 | template<typename T> struct IRef
 9 | {
10 | 	IRef() : m_refs(1) {}
11 | 	virtual ~IRef() {}
12 | 
13 | 	IRef(const IRef &) = delete;
14 | 	IRef &operator=(const IRef &) = delete;
15 | 
16 | 	virtual T* AddRef()
17 | 	{
18 | 		m_refs++;
19 | 		return (T*)this;
20 | 	}
21 | 
22 | 	virtual long Release()
23 | 	{
24 | 		intptr_t count = --m_refs;
25 | 		assert(count >= 0);
26 | 		if (count == 0) delete (T*)this;
27 | 		return count;
28 | 	}
29 | 	std::atomic_intptr_t m_refs;
30 | };
31 | 
32 | 
33 | NS_KRMOVIE_END


--------------------------------------------------------------------------------
/src/core/movie/ffmpeg/TVPMediaDemux.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/movie/ffmpeg/TVPMediaDemux.cpp


--------------------------------------------------------------------------------
/src/core/movie/ffmpeg/TVPMediaDemux.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/movie/ffmpeg/TVPMediaDemux.h


--------------------------------------------------------------------------------
/src/core/movie/ffmpeg/Thread.cpp:
--------------------------------------------------------------------------------
 1 | #include "Thread.h"
 2 | #include <thread>
 3 | #include <stdexcept>
 4 | #include "MsgIntf.h"
 5 | #include "ThreadImpl.h"
 6 | 
 7 | NS_KRMOVIE_BEGIN
 8 | 
 9 | CThread::CThread()
10 | 	: m_bStop(false), m_bRunning(false)
11 | {
12 | 
13 | }
14 | 
15 | CThread::~CThread()
16 | {
17 | 	if (m_bRunning) {
18 | 		StopThread();
19 | 	}
20 | 	if (m_ThreadId) {
21 | 		m_ThreadId->join(); delete m_ThreadId;
22 | 	}
23 | }
24 | 
25 | void CThread::Create()
26 | {
27 | 	if (m_bRunning.exchange(true)) {
28 | 		TVPThrowExceptionMessage(TJS_W("thread already in running"));
29 | 	}
30 | 	m_bStop = false;
31 | 	if (m_ThreadId) {
32 | 		m_ThreadId->join(); delete m_ThreadId;
33 | 	}
34 | 	m_ThreadId = new std::thread(&CThread::entry, this);
35 | }
36 | 
37 | void CThread::StopThread(bool bWait /*= true*/)
38 | {
39 | 	m_bStop = true;
40 | 	m_StopEvent.notify_all();
41 | 	if (m_ThreadId && bWait) {
42 | 		m_ThreadId->join();
43 | 		delete m_ThreadId;
44 | 		m_ThreadId = nullptr;
45 | 	}
46 | }
47 | 
48 | void CThread::Sleep(unsigned int milliseconds)
49 | {
50 | 	if (IsCurrentThread()) {
51 | 		std::unique_lock<std::mutex> lock(m_mtxStopEvent);
52 | 		m_StopEvent.wait_for(lock, std::chrono::milliseconds(milliseconds));
53 | 	} else {
54 | 		std::this_thread::sleep_for(std::chrono::milliseconds(milliseconds));
55 | 	}
56 | }
57 | 
58 | bool CThread::IsCurrentThread()
59 | {
60 | 	if (!m_ThreadId) return false;
61 | 	return m_ThreadId->get_id() == std::this_thread::get_id();
62 | }
63 | 
64 | int CThread::entry()
65 | {
66 | 	OnStartup();
67 | 	Process();
68 | 	OnExit();
69 | 	m_bRunning = false;
70 | 	TVPOnThreadExited();
71 | 	return 0;
72 | }
73 | 
74 | NS_KRMOVIE_END
75 | 


--------------------------------------------------------------------------------
/src/core/movie/ffmpeg/Thread.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include "KRMovieDef.h"
 3 | #include <atomic>
 4 | #include <condition_variable>
 5 | #include <thread>
 6 | #include <mutex>
 7 | 
 8 | NS_KRMOVIE_BEGIN
 9 | typedef std::recursive_mutex CCriticalSection;
10 | typedef std::unique_lock<std::recursive_mutex> CSingleLock;
11 | class CThread {
12 | public:
13 | 	CThread();
14 | 	virtual ~CThread();
15 | 	void Create();
16 | 	bool IsRunning() const { return m_bRunning; }
17 | 	void StopThread(bool bWait = true);
18 | 	void Sleep(unsigned int milliseconds);
19 | 	bool IsCurrentThread();
20 | 
21 | protected:
22 | 	int entry();
23 | 	virtual void OnStartup() {}
24 | 	virtual void Process() = 0;
25 | 	virtual void OnExit() {}
26 | 
27 | 	std::thread *m_ThreadId = nullptr;
28 | 	std::atomic<bool> m_bStop, m_bRunning;
29 | 	std::mutex m_mtxStopEvent;
30 | 	std::condition_variable m_StopEvent;
31 | 	CCriticalSection m_CriticalSection;
32 | };
33 | 
34 | class CEvent {
35 | public:
36 | 	void Set() { m_cond.notify_all(); }
37 | 	void Reset() {}
38 | 	bool WaitMSec(unsigned int milliSeconds) {
39 | 		CSingleLock lock(mutex);
40 | 		return m_cond.wait_for(lock, std::chrono::milliseconds(milliSeconds)) != std::cv_status::timeout;
41 | 	}
42 | 	void Wait() {
43 | 		CSingleLock lock(mutex);
44 | 		m_cond.wait(lock);
45 | 	}
46 | 
47 | protected:
48 | 	CCriticalSection mutex;
49 | 	std::condition_variable_any m_cond;
50 | };
51 | NS_KRMOVIE_END


--------------------------------------------------------------------------------
/src/core/movie/ffmpeg/TimeUtils.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include "KRMovieDef.h"
 3 | #include <stdint.h>
 4 | #include <time.h>
 5 | NS_KRMOVIE_BEGIN
 6 | class CDateTime;
 7 | 
 8 | int64_t CurrentHostCounter(void);
 9 | int64_t CurrentHostFrequency(void);
10 | 
11 | class CTimeUtils
12 | {
13 | public:
14 |   static void UpdateFrameTime(bool flip); ///< update the frame time.  Not threadsafe
15 |   static unsigned int GetFrameTime(); ///< returns the frame time in MS.  Not threadsafe
16 | //  static CDateTime GetLocalTime(time_t time);
17 | 
18 | private:
19 |   static unsigned int frameTime;
20 | };
21 | 
22 | NS_KRMOVIE_END


--------------------------------------------------------------------------------
/src/core/movie/ffmpeg/Timer.cpp:
--------------------------------------------------------------------------------
1 | #include <time.h>
2 | #include "Timer.h"
3 | #include <limits>
4 | 
5 | NS_KRMOVIE_BEGIN
6 | const unsigned int Timer::InfiniteValue = std::numeric_limits<unsigned int>::max();
7 | NS_KRMOVIE_END
8 | 


--------------------------------------------------------------------------------
/src/core/movie/ffmpeg/Timer.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include "KRMovieDef.h"
 3 | #include "TickCount.h"
 4 | 
 5 | NS_KRMOVIE_BEGIN
 6 | class Timer {
 7 | 	unsigned int startTime;
 8 | 	unsigned int totalWaitTime;
 9 | public:
10 | 	static const unsigned int InfiniteValue;
11 | 	inline Timer() : startTime(0), totalWaitTime(0) {}
12 | 	inline Timer(unsigned int millisecondsIntoTheFuture) : startTime(TVPGetRoughTickCount32()), totalWaitTime(millisecondsIntoTheFuture) {}
13 | 
14 | 	inline void Set(unsigned int millisecondsIntoTheFuture) { startTime = TVPGetRoughTickCount32(); totalWaitTime = millisecondsIntoTheFuture; }
15 | 	inline bool IsTimePast() const { return totalWaitTime == InfiniteValue ? false : (totalWaitTime == 0 ? true : (TVPGetRoughTickCount32() - startTime) >= totalWaitTime); }
16 | 
17 | 	inline unsigned int MillisLeft() const
18 | 	{
19 | 		if (totalWaitTime == InfiniteValue)
20 | 			return InfiniteValue;
21 | 		if (totalWaitTime == 0)
22 | 			return 0;
23 | 		unsigned int timeWaitedAlready = (TVPGetRoughTickCount32() - startTime);
24 | 		return (timeWaitedAlready >= totalWaitTime) ? 0 : (totalWaitTime - timeWaitedAlready);
25 | 	}
26 | 	
27 | 	inline void SetExpired() { totalWaitTime = 0; }
28 | 	inline void SetInfinite() { totalWaitTime = InfiniteValue; }
29 | 	inline bool IsInfinite(void) const { return (totalWaitTime == InfiniteValue); }
30 | 	inline unsigned int GetInitialTimeoutValue(void) const { return totalWaitTime; }
31 | 	inline unsigned int GetStartTime(void) const { return startTime; }
32 | };
33 | NS_KRMOVIE_END
34 | 


--------------------------------------------------------------------------------
/src/core/movie/ffmpeg/config.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "ffplay_util.h"


--------------------------------------------------------------------------------
/src/core/movie/krmovie.cpp:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | // krmovie.cpp ( part of KRMOVIE.DLL )
 3 | // (c)2001-2009, W.Dee <dee@kikyou.info> and contributors
 4 | //---------------------------------------------------------------------------
 5 | 
 6 | /*
 7 | 	We must separate this module because sucking MS library has a lack of
 8 | 	compiler portability.
 9 | 
10 | 	This requires DirectX7 or later or Windows Media Player 6.4 or later for
11 | 	playbacking MPEG streams.
12 | 
13 | 	Modified by T.Imoto <http://www.kaede-software.com>
14 | */
15 | 
16 | //---------------------------------------------------------------------------
17 | 
18 | 
19 | #include "tjsCommHead.h"
20 | #include "SysInitIntf.h"
21 | #include "PluginImpl.h"
22 | #include "krmovie.h"
23 | 


--------------------------------------------------------------------------------
/src/core/msg/win32/OptionsDesc.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000-2007 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | #ifndef OptionsDescH
10 | #define OptionsDescH
11 | 
12 | extern ttstr TVPGetCommandDesc();
13 | 
14 | #endif
15 | //---------------------------------------------------------------------------
16 | 


--------------------------------------------------------------------------------
/src/core/msg/win32/ReadOptionDesc.h:
--------------------------------------------------------------------------------
 1 | 
 2 | #ifndef __READ_OPTION_DESC_H__
 3 | #define __READ_OPTION_DESC_H__
 4 | 
 5 | struct tTVPCommandOptionsValue {
 6 | 	std::wstring Value;
 7 | 	std::wstring Description;
 8 | 	bool IsDefault;
 9 | };
10 | struct tTVPCommandOption {
11 | 	enum ValueType {
12 | 		VT_Select,
13 | 		VT_String,
14 | 		VT_Unknown
15 | 	};
16 | 	std::wstring Caption;
17 | 	std::wstring Description;
18 | 	std::wstring Name;
19 | 	ValueType Type;
20 | 	tjs_int Length;
21 | 	std::wstring Value;
22 | 	std::vector<tTVPCommandOptionsValue> Values;
23 | 	bool User;
24 | };
25 | struct tTVPCommandOptionCategory {
26 | 	std::wstring Name;
27 | 	std::vector<tTVPCommandOption> Options;
28 | };
29 | struct tTVPCommandOptionList {
30 | 	std::vector<tTVPCommandOptionCategory> Categories;
31 | };
32 | 
33 | extern bool TVPUtf8ToUtf16( std::wstring& out, const std::string& in );
34 | extern bool TVPUtf16ToUtf8( std::string& out, const std::wstring& in );
35 | extern tTVPCommandOptionList* TVPGetPluginCommandDesc( const wchar_t* name );
36 | extern tTVPCommandOptionList* TVPGetEngineCommandDesc();
37 | void TVPMargeCommandDesc( tTVPCommandOptionList& dest, const tTVPCommandOptionList& src );
38 | 
39 | #endif // __READ_OPTION_DESC_H__
40 | 


--------------------------------------------------------------------------------
/src/core/sound/ARM/WaveFunctionARM.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/sound/ARM/WaveFunctionARM.cpp


--------------------------------------------------------------------------------
/src/core/sound/FFWaveDecoder.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include "WaveIntf.h"
 3 | 
 4 | class FFWaveDecoderCreator : public tTVPWaveDecoderCreator
 5 | {
 6 | public:
 7 |     //VorbisWaveDecoderCreator() { TVPRegisterWaveDecoderCreator(this); }
 8 |     tTVPWaveDecoder * Create(const ttstr & storagename, const ttstr & extension);
 9 | };
10 | 


--------------------------------------------------------------------------------
/src/core/sound/MathAlgorithms.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/sound/MathAlgorithms.cpp


--------------------------------------------------------------------------------
/src/core/sound/MathAlgorithms.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/sound/MathAlgorithms.h


--------------------------------------------------------------------------------
/src/core/sound/PhaseVocoderDSP.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/sound/PhaseVocoderDSP.cpp


--------------------------------------------------------------------------------
/src/core/sound/PhaseVocoderDSP.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/sound/PhaseVocoderDSP.h


--------------------------------------------------------------------------------
/src/core/sound/PhaseVocoderFilter.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/sound/PhaseVocoderFilter.cpp


--------------------------------------------------------------------------------
/src/core/sound/RingBuffer.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/sound/RingBuffer.h


--------------------------------------------------------------------------------
/src/core/sound/VorbisWaveDecoder.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include "WaveIntf.h"
 3 | 
 4 | class VorbisWaveDecoderCreator : public tTVPWaveDecoderCreator
 5 | {
 6 | public:
 7 |     //VorbisWaveDecoderCreator() { TVPRegisterWaveDecoderCreator(this); }
 8 |     tTVPWaveDecoder * Create(const ttstr & storagename, const ttstr & extension);
 9 | };
10 | 
11 | class OpusWaveDecoderCreator : public tTVPWaveDecoderCreator
12 | {
13 | public:
14 |     //VorbisWaveDecoderCreator() { TVPRegisterWaveDecoderCreator(this); }
15 |     tTVPWaveDecoder * Create(const ttstr & storagename, const ttstr & extension);
16 | };


--------------------------------------------------------------------------------
/src/core/sound/WaveFormatConverter.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/sound/WaveFormatConverter.cpp


--------------------------------------------------------------------------------
/src/core/sound/WaveFormatConverter_SSE.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/sound/WaveFormatConverter_SSE.cpp


--------------------------------------------------------------------------------
/src/core/sound/win32/SoundBufferBaseImpl.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // Sound Buffer Base implementation
10 | //---------------------------------------------------------------------------
11 | 
12 | #ifndef SoundBufferBaseImplH
13 | #define SoundBufferBaseImplH
14 | 
15 | #define TVP_SB_BEAT_INTERVAL 60
16 | 
17 | #include "SoundBufferBaseIntf.h"
18 | 
19 | 
20 | //---------------------------------------------------------------------------
21 | class tTJSNI_SoundBuffer : public tTJSNI_BaseSoundBuffer
22 | {
23 | 	typedef tTJSNI_BaseSoundBuffer inherited;
24 | 
25 | public:
26 | 	tTJSNI_SoundBuffer();
27 | 	tjs_error TJS_INTF_METHOD Construct(tjs_int numparams, tTJSVariant **param,
28 | 		iTJSDispatch2 *tjs_obj);
29 | 	void TJS_INTF_METHOD Invalidate();
30 | 
31 | public:
32 | 
33 | protected:
34 | };
35 | //---------------------------------------------------------------------------
36 | #endif
37 | 


--------------------------------------------------------------------------------
/src/core/sound/win32/kmp_pi.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/sound/win32/kmp_pi.h


--------------------------------------------------------------------------------
/src/core/sound/win32/oldwaveunpacker.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/sound/win32/oldwaveunpacker.h


--------------------------------------------------------------------------------
/src/core/sound/win32/tvpsnd.c:
--------------------------------------------------------------------------------
 1 | /* this file contains the actual definitions of */
 2 | /* the IIDs and CLSIDs */
 3 | 
 4 | /* link this file in with the server and any clients */
 5 | 
 6 | 
 7 | /* File created by MIDL compiler version 5.01.0164 */
 8 | /* at Tue Oct 03 00:37:04 2000
 9 |  */
10 | /* Compiler settings for tvpsnd.idl:
11 |     Os (OptLev=s), W1, Zp8, env=Win32, ms_ext, c_ext
12 |     error checks: allocation ref bounds_check enum stub_data 
13 | */
14 | //@@MIDL_FILE_HEADING(  )
15 | #ifdef __cplusplus
16 | extern "C"{
17 | #endif 
18 | 
19 | 
20 | #ifndef __IID_DEFINED__
21 | #define __IID_DEFINED__
22 | 
23 | typedef struct _IID
24 | {
25 |     unsigned long x;
26 |     unsigned short s1;
27 |     unsigned short s2;
28 |     unsigned char  c[8];
29 | } IID;
30 | 
31 | #endif // __IID_DEFINED__
32 | 
33 | #ifndef CLSID_DEFINED
34 | #define CLSID_DEFINED
35 | typedef IID CLSID;
36 | #endif // CLSID_DEFINED
37 | 
38 | const IID LIBID_TVPSndSysLib = {0xF09B2E87,0x740A,0x4AEA,{0x90,0xCB,0xAE,0x1C,0x4E,0xFD,0x35,0xF1}};
39 | 
40 | 
41 | const IID IID_ITSSMediaBaseInfo = {0xB4C4239B,0x7D27,0x43CC,{0x85,0x23,0x66,0x95,0x5B,0xDF,0x59,0xDF}};
42 | 
43 | 
44 | const IID IID_ITSSStorageProvider = {0x7DD61993,0x615D,0x481D,{0xB0,0x60,0xA9,0xFD,0x48,0x39,0x44,0x30}};
45 | 
46 | 
47 | const IID IID_ITSSModule = {0xA938D1A5,0x2980,0x498B,{0xB0,0x51,0x99,0x93,0x1D,0x41,0x89,0x5D}};
48 | 
49 | 
50 | const IID IID_ITSSWaveDecoder = {0x313864E2,0x910E,0x496F,{0x8A,0x6D,0x43,0x46,0x5C,0x10,0x5B,0x58}};
51 | 
52 | 
53 | #ifdef __cplusplus
54 | }
55 | #endif
56 | 
57 | 


--------------------------------------------------------------------------------
/src/core/sound/win32/tvpsnd.cpp:
--------------------------------------------------------------------------------
 1 | /* this file contains the actual definitions of */
 2 | /* the IIDs and CLSIDs */
 3 | 
 4 | /* link this file in with the server and any clients */
 5 | 
 6 | 
 7 | /* File created by MIDL compiler version 5.01.0164 */
 8 | /* at Tue Oct 03 00:37:04 2000
 9 |  */
10 | /* Compiler settings for tvpsnd.idl:
11 |     Os (OptLev=s), W1, Zp8, env=Win32, ms_ext, c_ext
12 |     error checks: allocation ref bounds_check enum stub_data 
13 | */
14 | //@@MIDL_FILE_HEADING(  )
15 | #include "combase.h"
16 | #ifdef __cplusplus
17 | extern "C"{
18 | #endif 
19 | 
20 | 	extern const IID LIBID_TVPSndSysLib = { 0xF09B2E87, 0x740A, 0x4AEA, { 0x90, 0xCB, 0xAE, 0x1C, 0x4E, 0xFD, 0x35, 0xF1 } };
21 | 
22 | 	extern const IID IID_ITSSMediaBaseInfo = { 0xB4C4239B, 0x7D27, 0x43CC, { 0x85, 0x23, 0x66, 0x95, 0x5B, 0xDF, 0x59, 0xDF } };
23 | 
24 | 	extern const IID IID_ITSSStorageProvider = { 0x7DD61993, 0x615D, 0x481D, { 0xB0, 0x60, 0xA9, 0xFD, 0x48, 0x39, 0x44, 0x30 } };
25 | 
26 | 	extern const IID IID_ITSSModule = { 0xA938D1A5, 0x2980, 0x498B, { 0xB0, 0x51, 0x99, 0x93, 0x1D, 0x41, 0x89, 0x5D } };
27 | 
28 | 	extern const IID IID_ITSSWaveDecoder = { 0x313864E2, 0x910E, 0x496F, { 0x8A, 0x6D, 0x43, 0x46, 0x5C, 0x10, 0x5B, 0x58 } };
29 | 
30 |     extern const IID IID_IUnknown = {0,0,0,{0, 0xc0, 0, 0, 0, 0x46}};//00000000-0000-0000-C000-000000000046
31 |     extern const IID IID_IStream = {0xC,0,0,{0, 0xc0, 0, 0, 0, 0x46}};//0000000C-0000-0000-C000-000000000046
32 |     extern const IID IID_ISequentialStream = {0x0c733a30,0x2a1c,0x11ce,{0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d}};
33 | #ifdef __cplusplus
34 | }
35 | #endif
36 | 
37 | 


--------------------------------------------------------------------------------
/src/core/sound/win32/tvpsnd.idl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/sound/win32/tvpsnd.idl


--------------------------------------------------------------------------------
/src/core/tjs2/tjsBinarySerializer.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/tjs2/tjsBinarySerializer.cpp


--------------------------------------------------------------------------------
/src/core/tjs2/tjsBinarySerializer.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/tjs2/tjsBinarySerializer.h


--------------------------------------------------------------------------------
/src/core/tjs2/tjsByteCodeLoader.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/tjs2/tjsByteCodeLoader.cpp


--------------------------------------------------------------------------------
/src/core/tjs2/tjsByteCodeLoader.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/tjs2/tjsByteCodeLoader.h


--------------------------------------------------------------------------------
/src/core/tjs2/tjsCommHead.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TJS2 Script Engine
 4 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // tjs common header
10 | //---------------------------------------------------------------------------
11 | 
12 | 
13 | /*
14 | 	Add headers that would not be frequently changed.
15 | */
16 | #ifndef tjsCommHeadH
17 | #define tjsCommHeadH
18 | 
19 | #ifdef __WIN32__
20 | #define _CRT_SECURE_NO_WARNINGS
21 | #define WIN32_LEAN_AND_MEAN
22 | //#include "targetver.h"
23 | //#include <windows.h>
24 | 
25 | #include <vector>
26 | 
27 | #ifdef  _DEBUG
28 | #define _CRTDBG_MAP_ALLOC
29 | #include <cstdlib>
30 | #include <crtdbg.h>
31 | #define TJS_CRTDBG_MAP_ALLOC
32 | #endif  // _DEBUG
33 | 
34 | /*
35 | #ifndef DEBUG_NEW
36 | #ifdef  _DEBUG
37 | #define DEBUG_NEW   ::new(_NORMAL_BLOCK, __FILE__, __LINE__)
38 | #else   // _DEBUG
39 | #define DEBUG_NEW   new
40 | #endif  // _DEBUG
41 | #endif  // DEBUG_NEW
42 | #define new DEBUG_NEW
43 | */
44 | 
45 | #endif
46 | 
47 | 
48 | #include <string.h>
49 | #ifndef __USE_UNIX98
50 | #define __USE_UNIX98
51 | #endif
52 | #include <wchar.h>
53 | #include <stdlib.h>
54 | #include <stdio.h>
55 | #include <memory>
56 | 
57 | #include <vector>
58 | #include <string>
59 | #include <stdexcept>
60 | 
61 | #include "tjsConfig.h"
62 | #include "tjs.h"
63 | 
64 | //---------------------------------------------------------------------------
65 | #endif
66 | 
67 | 
68 | 


--------------------------------------------------------------------------------
/src/core/tjs2/tjsCompileControl.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TJS2 Script Engine
 4 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // Conditional Compile Control
10 | //---------------------------------------------------------------------------
11 | 
12 | #ifndef tjsCompileControlH
13 | #define tjsCompileControlH
14 | 
15 | #include "tjsString.h"
16 | 
17 | namespace TJS
18 | {
19 | //---------------------------------------------------------------------------
20 | class tTJS;
21 | class tTJSPPExprParser
22 | {
23 | public:
24 | 	tTJSPPExprParser(tTJS *tjs, const tjs_char *script);
25 | 	~tTJSPPExprParser();
26 | 
27 | 	tjs_int32 Parse();
28 | 
29 | 	tTJS * TJS;
30 | 	tjs_int GetNext (tjs_int &value);
31 | 
32 | 	tTJS * GetTJS() { return TJS; }
33 | 
34 | 	const tjs_char * GetString(tjs_int idx) const ;
35 | 
36 | 	tjs_int32 Result;
37 | 
38 | private:
39 | 	std::vector<ttstr > IDs;
40 | 
41 | 	const tjs_char *Script;
42 | 	const tjs_char *Current;
43 | 
44 | };
45 | //---------------------------------------------------------------------------
46 | //---------------------------------------------------------------------------
47 | }
48 | 
49 | #endif
50 | 


--------------------------------------------------------------------------------
/src/core/tjs2/tjsConfig.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/tjs2/tjsConfig.cpp


--------------------------------------------------------------------------------
/src/core/tjs2/tjsConstArrayData.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/tjs2/tjsConstArrayData.cpp


--------------------------------------------------------------------------------
/src/core/tjs2/tjsConstArrayData.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/tjs2/tjsConstArrayData.h


--------------------------------------------------------------------------------
/src/core/tjs2/tjsDate.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TJS2 Script Engine
 4 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // Date class implementation
10 | //---------------------------------------------------------------------------
11 | 
12 | #ifndef tjsDateH
13 | #define tjsDateH
14 | 
15 | #include <time.h>
16 | #include "tjsNative.h"
17 | 
18 | namespace TJS
19 | {
20 | //---------------------------------------------------------------------------
21 | class tTJSNI_Date : public tTJSNativeInstance
22 | {
23 | public:
24 | 	tTJSNI_Date();
25 | 	time_t DateTime;
26 | private:
27 | };
28 | 
29 | //---------------------------------------------------------------------------
30 | class tTJSNC_Date : public tTJSNativeClass
31 | {
32 | public:
33 | 	tTJSNC_Date();
34 | 
35 | 	static tjs_uint32 ClassID;
36 | 
37 | private:
38 | 	tTJSNativeInstance *CreateNativeInstance();
39 | };
40 | //---------------------------------------------------------------------------
41 | } // namespace TJS
42 | 
43 | #endif
44 | 


--------------------------------------------------------------------------------
/src/core/tjs2/tjsDebug.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/tjs2/tjsDebug.cpp


--------------------------------------------------------------------------------
/src/core/tjs2/tjsDebug.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/tjs2/tjsDebug.h


--------------------------------------------------------------------------------
/src/core/tjs2/tjsError_jp.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/tjs2/tjsError_jp.h


--------------------------------------------------------------------------------
/src/core/tjs2/tjsException.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TJS2 Script Engine
 4 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // TJS Exception Class
10 | //---------------------------------------------------------------------------
11 | #ifndef tjsExceptionH
12 | #define tjsExceptionH
13 | 
14 | #include "tjsNative.h"
15 | 
16 | namespace TJS
17 | {
18 | //---------------------------------------------------------------------------
19 | // tTJSNC_Exception
20 | //---------------------------------------------------------------------------
21 | class tTJSNC_Exception : public tTJSNativeClass
22 | {
23 | public:
24 | 	tTJSNC_Exception();
25 | private:
26 | 	static tjs_uint32 ClassID;
27 | };
28 | //---------------------------------------------------------------------------
29 | } // namespace TJS
30 | 
31 | #endif
32 | 


--------------------------------------------------------------------------------
/src/core/tjs2/tjsGlobalStringMap.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TJS2 Script Engine
 4 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // TJS Global String Map
10 | //---------------------------------------------------------------------------
11 | #ifndef tjsGlobalStringMapH
12 | #define tjsGlobalStringMapH
13 | 
14 | #include "tjsString.h"
15 | 
16 | namespace TJS
17 | {
18 | //---------------------------------------------------------------------------
19 | // tTJSGlobalStringMap - hash map to keep constant strings shared
20 | //---------------------------------------------------------------------------
21 | extern void TJSAddRefGlobalStringMap();
22 | extern void TJSReleaseGlobalStringMap();
23 | TJS_EXP_FUNC_DEF(ttstr, TJSMapGlobalStringMap, (const ttstr & string));
24 | //---------------------------------------------------------------------------
25 | } // namespace TJS
26 | 
27 | #endif
28 | 


--------------------------------------------------------------------------------
/src/core/tjs2/tjsInterCodeExec.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/tjs2/tjsInterCodeExec.cpp


--------------------------------------------------------------------------------
/src/core/tjs2/tjsInterCodeExec.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TJS2 Script Engine
 4 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // Intermediate Code Execution
10 | //---------------------------------------------------------------------------
11 | 
12 | #ifndef tjsInterCodeExecH
13 | #define tjsInterCodeExecH
14 | 
15 | 
16 | namespace TJS
17 | {
18 | //---------------------------------------------------------------------------
19 | #if 0
20 | extern void TJSVariantArrayStackAddRef();
21 | extern void TJSVariantArrayStackRelease();
22 | #endif
23 | extern void TJSVariantArrayStackCompact();
24 | extern void TJSVariantArrayStackCompactNow();
25 | 
26 | class tTJSVariantArrayStack
27 | {
28 | 	//	tTJSCriticalSection CS;
29 | 
30 | 	struct tVariantArray
31 | 	{
32 | 		tTJSVariant *Array;
33 | 		tjs_int Using;
34 | 		tjs_int Allocated;
35 | 	};
36 | 
37 | 	tVariantArray * Arrays; // array of array
38 | 	tjs_int NumArraysAllocated;
39 | 	tjs_int NumArraysUsing;
40 | 	tVariantArray * Current;
41 | 	tjs_int CompactVariantArrayMagic;
42 | 	tjs_int OperationDisabledCount;
43 | 
44 | 	void IncreaseVariantArray(tjs_int num);
45 | 
46 | 	void DecreaseVariantArray(void);
47 | 
48 | 	void InternalCompact(void);
49 | 
50 | 
51 | public:
52 | 	tTJSVariantArrayStack();
53 | 	~tTJSVariantArrayStack();
54 | 
55 | 	tTJSVariant * Allocate(tjs_int num);
56 | 
57 | 	void Deallocate(tjs_int num, tTJSVariant *ptr);
58 | 
59 | 	void Compact() { InternalCompact(); }
60 | 
61 | }/* *TJSVariantArrayStack = NULL*/;
62 | //---------------------------------------------------------------------------
63 | }
64 | 
65 | 
66 | #endif
67 | 


--------------------------------------------------------------------------------
/src/core/tjs2/tjsInterCodeGen.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/tjs2/tjsInterCodeGen.cpp


--------------------------------------------------------------------------------
/src/core/tjs2/tjsInterface.cpp:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TJS2 Script Engine
 4 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // iTJSDispatch2 interface definition
10 | //---------------------------------------------------------------------------
11 | 
12 | #include "tjsCommHead.h"
13 | 
14 | #include "tjsInterface.h"
15 | 
16 | namespace TJS
17 | {
18 | //---------------------------------------------------------------------------
19 | 
20 | 
21 | //---------------------------------------------------------------------------
22 | } // namespace TJS
23 | 
24 | 
25 | 


--------------------------------------------------------------------------------
/src/core/tjs2/tjsMath.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TJS2 Script Engine
 4 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // TJS Math class implementation
10 | //---------------------------------------------------------------------------
11 | #ifndef tjsMathH
12 | #define tjsMathH
13 | 
14 | #include "tjsNative.h"
15 | 
16 | 
17 | namespace TJS
18 | {
19 | 
20 | //---------------------------------------------------------------------------
21 | class tTJSNC_Math : public tTJSNativeClass
22 | {
23 | public:
24 | 	tTJSNC_Math();
25 | private:
26 | 	static tjs_uint32 ClassID;
27 | 
28 | };
29 | //---------------------------------------------------------------------------
30 | } // namespace TJS
31 | 
32 | 
33 | #endif
34 | 


--------------------------------------------------------------------------------
/src/core/tjs2/tjsObjectExtendable.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/tjs2/tjsObjectExtendable.h


--------------------------------------------------------------------------------
/src/core/tjs2/tjsOctPack.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/tjs2/tjsOctPack.cpp


--------------------------------------------------------------------------------
/src/core/tjs2/tjsOctPack.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TJS2 Script Engine
 4 | 	Copyright (C) 2013 T.Imoto and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | 
10 | 
11 | #ifndef tjsOctPackH
12 | #define tjsOctPackH
13 | 
14 | 
15 | namespace TJS
16 | {
17 | extern tjs_error TJSOctetPack( tTJSVariant **args, tjs_int numargs, const std::vector<tTJSVariant>& items, tTJSVariant *result );
18 | extern tjs_error TJSOctetUnpack( const tTJSVariantOctet * target, tTJSVariant **args, tjs_int numargs, tTJSVariant *result );
19 | } // namespace TJS
20 | 
21 | #endif // tjsOctPackH
22 | 


--------------------------------------------------------------------------------
/src/core/tjs2/tjsScriptBlock.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/tjs2/tjsScriptBlock.cpp


--------------------------------------------------------------------------------
/src/core/tjs2/tjsUtils.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/tjs2/tjsUtils.h


--------------------------------------------------------------------------------
/src/core/utils/Debugger.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/utils/Debugger.h


--------------------------------------------------------------------------------
/src/core/utils/Exception.h:
--------------------------------------------------------------------------------
 1 | 
 2 | #ifndef __EXCEPTION_H__
 3 | #define __EXCEPTION_H__
 4 | 
 5 | 
 6 | class Exception /*: public std::exception*/ {
 7 | 	ttstr message_;
 8 | public:
 9 | 	Exception(const ttstr& mes) : message_(mes) {
10 | 	}
11 | 	virtual const ttstr& what() const {
12 | 		return message_;
13 | 	}
14 | };
15 | 
16 | class EAbort : public Exception {
17 | public:
18 | 	EAbort(const ttstr& mes) : Exception(mes) {
19 | 	}
20 | };
21 | 
22 | #endif // __EXCEPTION_H__
23 | 


--------------------------------------------------------------------------------
/src/core/utils/MathAlgorithms_Default.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	Risa [りさ]      alias 吉里吉里3 [kirikiri-3]
 4 | 	 stands for "Risa Is a Stagecraft Architecture"
 5 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 6 | 
 7 | 	See details of license at "license.txt"
 8 | */
 9 | //---------------------------------------------------------------------------
10 | //! @file
11 | //! @brief 数学関数群
12 | //---------------------------------------------------------------------------
13 | #ifndef MATHALGORITHMSH
14 | #define MATHALGORITHMSH
15 | 
16 | #include <stdlib.h>
17 | 
18 | 
19 | //---------------------------------------------------------------------------
20 | 
21 | //---------------------------------------------------------------------------
22 | /**
23 |  * 窓関数を適用しながらのインターリーブ解除
24 |  * @param dest		格納先(複数)
25 |  * @param src		ソース
26 |  * @param win		窓関数
27 |  * @param numch		チャンネル数
28 |  * @param destofs	destの処理開始位置
29 |  * @param len		処理するサンプル数
30 |  *					(各チャンネルごとの数; 実際に処理されるサンプル
31 |  *					数の総計はlen*numchになる)
32 |  */
33 | void DeinterleaveApplyingWindow(float *  dest[], const float *  src,
34 | 					float *  win, int numch, size_t destofs, size_t len);
35 | //---------------------------------------------------------------------------
36 | 
37 | 
38 | //---------------------------------------------------------------------------
39 | /**
40 |  * 窓関数を適用しながらのインターリーブ+オーバーラッピング
41 |  * @param dest		格納先
42 |  * @param src		ソース(複数)
43 |  * @param win		窓関数
44 |  * @param numch		チャンネル数
45 |  * @param srcofs	srcの処理開始位置
46 |  * @param len		処理するサンプル数
47 |  *					(各チャンネルごとの数; 実際に処理されるサンプル
48 |  *					数の総計はlen*numchになる)
49 |  */
50 | void  InterleaveOverlappingWindow(float *  dest,
51 | 	const float *  const *  src,
52 | 	float *  win, int numch, size_t srcofs, size_t len);
53 | //---------------------------------------------------------------------------
54 | 
55 | //---------------------------------------------------------------------------
56 | 
57 | 
58 | 
59 | #endif
60 | 
61 | 


--------------------------------------------------------------------------------
/src/core/utils/MiscUtility.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/utils/MiscUtility.cpp


--------------------------------------------------------------------------------
/src/core/utils/PadIntf.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/utils/PadIntf.h


--------------------------------------------------------------------------------
/src/core/utils/Random.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // Simple Pseudo Random Generator
10 | //---------------------------------------------------------------------------
11 | #ifndef RandomH
12 | #define RandomH
13 | //---------------------------------------------------------------------------
14 | 
15 | 
16 | TJS_EXP_FUNC_DEF(void, TVPPushEnvironNoise, (const void *buf, tjs_int bufsize));
17 | TJS_EXP_FUNC_DEF(void, TVPGetRandomBits128, (void *dest));
18 | 
19 | //---------------------------------------------------------------------------
20 | #endif
21 | 


--------------------------------------------------------------------------------
/src/core/utils/RealFFT.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	Risa [りさ]		 alias 吉里吉里3 [kirikiri-3]
 4 | 	 stands for "Risa Is a Stagecraft Architecture"
 5 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 6 | 
 7 | 	See details of license at "license.txt"
 8 | */
 9 | //---------------------------------------------------------------------------
10 | //! @file
11 | //! @brief 実数離散フーリエ変換
12 | //---------------------------------------------------------------------------
13 | #ifndef REALFFT_H
14 | #define REALFFT_H
15 | 
16 | /*
17 | 	Based on
18 | 		Real Discrete FFT package from
19 | 			http://momonga.t.u-tokyo.ac.jp/~ooura/fft-j.html
20 | 	and
21 | 		Ogg Vorbis Optimization Project
22 | 			http://homepage3.nifty.com/blacksword/
23 | */
24 | 
25 | //---------------------------------------------------------------------------
26 | 
27 |     void rdft(int, int, float * , int * , float * );
28 | 
29 | 
30 | //---------------------------------------------------------------------------
31 | 
32 | 
33 | #endif
34 | 


--------------------------------------------------------------------------------
/src/core/utils/ThreadIntf.cpp:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // Thread base class
10 | //---------------------------------------------------------------------------
11 | #include "tjsCommHead.h"
12 | 
13 | #include "ThreadIntf.h"
14 | #include "ThreadImpl.h"
15 | 
16 | //---------------------------------------------------------------------------
17 | //---------------------------------------------------------------------------
18 | 
19 | 
20 | 


--------------------------------------------------------------------------------
/src/core/utils/ThreadIntf.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // Thread base class
10 | //---------------------------------------------------------------------------
11 | #ifndef ThreadIntfH
12 | #define ThreadIntfH
13 | #include "tjsNative.h"
14 | #include <functional>
15 | 
16 | 
17 | //---------------------------------------------------------------------------
18 | // tTVPThreadPriority
19 | //---------------------------------------------------------------------------
20 | enum tTVPThreadPriority
21 | {
22 | 	ttpIdle, ttpLowest, ttpLower, ttpNormal, ttpHigher, ttpHighest, ttpTimeCritical
23 | };
24 | //---------------------------------------------------------------------------
25 | 
26 | #include "ThreadImpl.h"
27 | 
28 | /*[*/
29 | const tjs_int TVPMaxThreadNum = 8;
30 | typedef const std::function<void(int)> &TVP_THREAD_TASK_FUNC;
31 | /*]*/
32 | 
33 | TJS_EXP_FUNC_DEF(tjs_int, TVPGetProcessorNum, ());
34 | TJS_EXP_FUNC_DEF(tjs_int, TVPGetThreadNum, ());
35 | TJS_EXP_FUNC_DEF(void, TVPExecThreadTask, (int numThreads, TVP_THREAD_TASK_FUNC func));
36 | 
37 | #endif
38 | 


--------------------------------------------------------------------------------
/src/core/utils/TickCount.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // safe 64bit System Tick Count
10 | //---------------------------------------------------------------------------
11 | #ifndef TickCountH
12 | #define TickCountH
13 | #include "tjsTypes.h"
14 | 
15 | //---------------------------------------------------------------------------
16 | TJS_EXP_FUNC_DEF(tjs_uint64, TVPGetTickCount, ());
17 | extern tjs_uint32 TVPGetRoughTickCount32();
18 | extern void TVPStartTickCount();
19 | 	// this must be called before TVPGetTickCount(), in main thread.
20 | 	// this function can be called more than one time.
21 | //---------------------------------------------------------------------------
22 | 
23 | 
24 | 
25 | #endif
26 | 


--------------------------------------------------------------------------------
/src/core/utils/VelocityTracker.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/utils/VelocityTracker.cpp


--------------------------------------------------------------------------------
/src/core/utils/VelocityTracker.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/utils/VelocityTracker.h


--------------------------------------------------------------------------------
/src/core/utils/iconv/iconv.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | 
 3 | typedef unsigned long ucs4_t;
 4 | typedef struct _conv_t{
 5 |     unsigned int istate;
 6 |     unsigned int ostate;
 7 | } *conv_t;
 8 | /* Return code if invalid. (xxx_wctomb) */
 9 | #define RET_ILUNI      -1
10 | /* Return code if output buffer is too small. (xxx_wctomb, xxx_reset) */
11 | #define RET_TOOSMALL   -2
12 | /* Return code if invalid input after a shift sequence of n bytes was read.
13 |    (xxx_mbtowc) */
14 | #define RET_SHIFT_ILSEQ(n)  (-1-2*(n))
15 | /* Return code if invalid. (xxx_mbtowc) */
16 | #define RET_ILSEQ           RET_SHIFT_ILSEQ(0)
17 | /* Return code if only a shift sequence of n bytes was read. (xxx_mbtowc) */
18 | #define RET_TOOFEW(n)       (-2-2*(n))
19 | /* Retrieve the n from the encoded RET_... value. */
20 | #define DECODE_SHIFT_ILSEQ(r)  ((unsigned int)(RET_SHIFT_ILSEQ(0) - (r)) / 2)
21 | #define DECODE_TOOFEW(r)       ((unsigned int)(RET_TOOFEW(0) - (r)) / 2)
22 | 


--------------------------------------------------------------------------------
/src/core/utils/win32/ClipboardImpl.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000-2007 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // Clipboard Class interface
10 | //---------------------------------------------------------------------------
11 | #ifndef ClipboardImplH
12 | #define ClipboardImplH
13 | //---------------------------------------------------------------------------
14 | #include "tjsNative.h"
15 | #include "ClipboardIntf.h"
16 | 
17 | 
18 | 
19 | //---------------------------------------------------------------------------
20 | #endif
21 | 
22 | 


--------------------------------------------------------------------------------
/src/core/utils/win32/DebugImpl.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000-2007 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // Utilities for Debugging
10 | //---------------------------------------------------------------------------
11 | #ifndef DebugImplH
12 | #define DebugImplH
13 | 
14 | #include "DebugIntf.h"
15 | //---------------------------------------------------------------------------
16 | //---------------------------------------------------------------------------
17 | #endif
18 | 


--------------------------------------------------------------------------------
/src/core/utils/win32/PadImpl.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/utils/win32/PadImpl.cpp


--------------------------------------------------------------------------------
/src/core/utils/win32/TVPTimer.h:
--------------------------------------------------------------------------------
 1 | 
 2 | #ifndef __TVP_TIMER_H__
 3 | #define __TVP_TIMER_H__
 4 | 
 5 | class TVPTimerEventIntarface {
 6 | public:
 7 | 	virtual ~TVPTimerEventIntarface() {}
 8 | 	virtual void Handle() = 0;
 9 | };
10 | 
11 | template<typename T>
12 | class TVPTimerEvent : public TVPTimerEventIntarface {
13 | 	void (T::*handler_)();
14 | 	T* owner_;
15 | 
16 | public:
17 | 	TVPTimerEvent( T* owner, void (T::*Handler)() ) : owner_(owner), handler_(Handler) {}
18 | 	void Handle() { (owner_->*handler_)(); }
19 | };
20 | class tTVPTimerImpl;
21 | class TVPTimer {
22 | 	TVPTimerEventIntarface* event_;
23 | 	int		interval_;
24 | 	bool	enabled_;
25 | 
26 | 	void UpdateTimer();
27 | 
28 | 	void FireEvent() {
29 | 		if( event_ ) {
30 | 			event_->Handle();
31 | 		}
32 | 	}
33 | 
34 | 	friend class tTVPTimerImpl;
35 | 	tTVPTimerImpl *impl_;
36 | 
37 | public:
38 | 	TVPTimer();
39 | 	~TVPTimer();
40 | 
41 | 	template<typename T>
42 | 	void SetOnTimerHandler( T* owner, void (T::*Handler)() ) {
43 | 		if( event_ ) delete event_;
44 | 		event_ = new TVPTimerEvent<T>( owner, Handler );
45 | 		UpdateTimer();
46 | 	}
47 | 
48 | 	void SetInterval( int i ) {
49 | 		if( interval_ != i ) {
50 | 			interval_ = i;
51 | 			UpdateTimer();
52 | 		}
53 | 	}
54 | 	int GetInterval() const {
55 | 		return interval_;
56 | 	}
57 | 	void SetEnabled( bool b ) {
58 | 		if( enabled_ != b ) {
59 | 			enabled_ = b;
60 | 			UpdateTimer();
61 | 		}
62 | 	}
63 | 	bool GetEnable() const { return enabled_; }
64 | 
65 | 	static void ProgressAllTimer();
66 | };
67 | 
68 | 
69 | #endif // __TVP_TIMER_H__
70 | 


--------------------------------------------------------------------------------
/src/core/utils/win32/TimerImpl.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // Timer Object Implementation
10 | //---------------------------------------------------------------------------
11 | #ifndef TimerImplH
12 | #define TimerImplH
13 | 
14 | #include "TimerIntf.h"
15 | 
16 | //---------------------------------------------------------------------------
17 | // tTJSNI_Timer : Timer Native Instance
18 | //---------------------------------------------------------------------------
19 | class tTVPTimerThread;
20 | class tTJSNI_Timer : public tTJSNI_BaseTimer
21 | {
22 | 	typedef tTJSNI_BaseTimer inherited;
23 | 	friend class tTVPTimerThread;
24 | 
25 | 	tjs_uint64 Interval;
26 | 	tjs_uint64 NextTick;
27 | 	tjs_int PendingCount;
28 | 	bool Enabled;
29 | 
30 | public:
31 | 	tTJSNI_Timer();
32 | 	tjs_error TJS_INTF_METHOD Construct(tjs_int numparams, tTJSVariant **param,
33 | 		iTJSDispatch2 *tjs_obj);
34 | 	void TJS_INTF_METHOD Invalidate();
35 | 
36 | 	void InternalSetInterval(tjs_uint64 n) { Interval = n; }
37 | 	void SetInterval(tjs_uint64 n);
38 | 	tjs_uint64 GetInterval() const;
39 | 		// { return Interval; }
40 | 
41 | 	void ZeroPendingCount() { PendingCount = 0; }
42 | 
43 | 	void SetNextTick(tjs_uint64 n) { NextTick = n; }
44 | 	tjs_uint64 GetNextTick() const;
45 | 		// { return NextTick; }
46 | 		// bcc 5.5.1 has an inliner bug of bad returning of int64...
47 | 
48 | 	void InternalSetEnabled(bool b) { Enabled = b; }
49 | 	void SetEnabled(bool b);
50 | 	bool GetEnabled() const { return Enabled; }
51 | 
52 | 	void Trigger(tjs_uint n);
53 | 	void FirePendingEventsAndClear();
54 | 
55 | private:
56 | 	void CancelTrigger();
57 | };
58 | //---------------------------------------------------------------------------
59 | #endif
60 | 


--------------------------------------------------------------------------------
/src/core/visual/ARM/tvpgl_arm.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/ARM/tvpgl_arm.cpp


--------------------------------------------------------------------------------
/src/core/visual/ARM/tvpgl_arm_intf.h:
--------------------------------------------------------------------------------
 1 | /*
 2 | 	this is a part of TVP (KIRIKIRI) software source.
 3 | 	see other sources for license.
 4 | 	(C)2001-2007 W.Dee <dee@kikyou.info> and contributors
 5 | */
 6 | 
 7 | /* C-language interface to tvpgl_ia32.lib */
 8 | /* this file is always generated by summary.pl */
 9 | 
10 | #ifndef __TVPGL_ARM_INTF__
11 | #define __TVPGL_ARM_INTF__
12 | 
13 | #include "tjsTypes.h"
14 | #include "tvpgl.h"
15 | 
16 | 
17 | #endif
18 | 


--------------------------------------------------------------------------------
/src/core/visual/BitmapIntf.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/BitmapIntf.cpp


--------------------------------------------------------------------------------
/src/core/visual/BitmapIntf.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/BitmapIntf.h


--------------------------------------------------------------------------------
/src/core/visual/BitmapLayerTreeOwner.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/BitmapLayerTreeOwner.cpp


--------------------------------------------------------------------------------
/src/core/visual/BitmapLayerTreeOwner.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/BitmapLayerTreeOwner.h


--------------------------------------------------------------------------------
/src/core/visual/CharacterData.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/CharacterData.cpp


--------------------------------------------------------------------------------
/src/core/visual/CharacterData.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/CharacterData.h


--------------------------------------------------------------------------------
/src/core/visual/FontImpl.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include "tjs.h"
 3 | #include "tjsHashSearch.h"
 4 | #include <functional>
 5 | 
 6 | void TVPInitFontNames();
 7 | int TVPEnumFontsProc(const ttstr &FontPath);
 8 | const ttstr &TVPGetDefaultFontName();
 9 | tTJSBinaryStream* TVPCreateFontStream(const ttstr &fontname);
10 | struct TVPFontNamePathInfo {
11 |     ttstr Path;
12 | 	std::function<tTJSBinaryStream*(TVPFontNamePathInfo*)> Getter;
13 |     int Index;
14 | };
15 | TVPFontNamePathInfo* TVPFindFont(const ttstr &name);
16 | 
17 | //---------------------------------------------------------------------------
18 | // font enumeration and existence check
19 | //---------------------------------------------------------------------------
20 | class tTVPttstrHash
21 | {
22 | public:
23 |     static tjs_uint32 Make(const ttstr &val);
24 | };
25 | extern tTJSHashTable<ttstr, TVPFontNamePathInfo, tTVPttstrHash>
26 |     TVPFontNames;


--------------------------------------------------------------------------------
/src/core/visual/FontRasterizer.h:
--------------------------------------------------------------------------------
 1 | 
 2 | #ifndef __FONT_RASTERIZER_H__
 3 | #define __FONT_RASTERIZER_H__
 4 | 
 5 | class FontRasterizer {
 6 | 
 7 | public:
 8 | 	virtual ~FontRasterizer() {}
 9 | 	virtual void AddRef() = 0;
10 | 	virtual void Release() = 0;
11 | 	virtual void ApplyFont( class tTVPNativeBaseBitmap *bmp, bool force ) = 0;
12 | 	virtual void ApplyFont( const struct tTVPFont& font ) = 0;
13 | 	virtual void GetTextExtent(tjs_char ch, tjs_int &w, tjs_int &h) = 0;
14 | 	virtual tjs_int GetAscentHeight() = 0;
15 | 	virtual class tTVPCharacterData* GetBitmap( const struct tTVPFontAndCharacterData & font, tjs_int aofsx, tjs_int aofsy ) = 0;
16 | 	virtual void GetGlyphDrawRect( const ttstr & text, struct tTVPRect& area ) = 0;
17 | };
18 | 
19 | #endif // __FREE_TYPE_FONT_RASTERIZER_H__
20 | 


--------------------------------------------------------------------------------
/src/core/visual/FontSystem.h:
--------------------------------------------------------------------------------
 1 | 
 2 | #ifndef __FONT_SYSTEM_H__
 3 | #define __FONT_SYSTEM_H__
 4 | 
 5 | #include "tjsCommHead.h"
 6 | #include "tvpfontstruc.h"
 7 | #include "tjsHashSearch.h"
 8 | #include <string>
 9 | 
10 | class tTVPWStringHash {
11 | public:
12 | 	static tjs_uint32 Make(const ttstr &val)
13 | 	{
14 | 		const tjs_char* ptr = val.c_str();
15 | 		if(*ptr == 0) return 0;
16 | 		tjs_uint32 v = 0;
17 | 		while(*ptr)
18 | 		{
19 | 			v += *ptr;
20 | 			v += (v << 10);
21 | 			v ^= (v >> 6);
22 | 			ptr++;
23 | 		}
24 | 		v += (v << 3);
25 | 		v ^= (v >> 11);
26 | 		v += (v << 15);
27 | 		if(!v) v = (tjs_uint32)-1;
28 | 		return v;
29 | 	}
30 | };
31 | 
32 | class FontSystem {
33 | 	bool FontNamesInit;
34 | 	tTJSHashTable<ttstr, tjs_int, tTVPWStringHash> TVPFontNames;
35 | 
36 | 	tTVPFont DefaultFont;
37 | 	bool DefaultLOGFONTCreated;
38 | 
39 | 	void InitFontNames();
40 | 	//---------------------------------------------------------------------------
41 | 	void AddFont(const ttstr& name);
42 | 	//---------------------------------------------------------------------------
43 | 	bool FontExists(const ttstr &name);
44 | 
45 | 	void ConstructDefaultFont();
46 | 
47 | public:
48 | 	FontSystem();
49 | 	ttstr GetBeingFont(ttstr fonts);
50 | 	const tTVPFont& GetDefaultFont() const {
51 | 		return DefaultFont;
52 | 	}
53 | };
54 | 
55 | #endif // __FONT_SYSTEM_H__
56 | 
57 | 


--------------------------------------------------------------------------------
/src/core/visual/FreeType.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/FreeType.cpp


--------------------------------------------------------------------------------
/src/core/visual/FreeType.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/FreeType.h


--------------------------------------------------------------------------------
/src/core/visual/FreeTypeFace.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/FreeTypeFace.h


--------------------------------------------------------------------------------
/src/core/visual/FreeTypeFontRasterizer.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/FreeTypeFontRasterizer.cpp


--------------------------------------------------------------------------------
/src/core/visual/FreeTypeFontRasterizer.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/FreeTypeFontRasterizer.h


--------------------------------------------------------------------------------
/src/core/visual/GraphicsLoadThread.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/GraphicsLoadThread.cpp


--------------------------------------------------------------------------------
/src/core/visual/GraphicsLoadThread.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/GraphicsLoadThread.h


--------------------------------------------------------------------------------
/src/core/visual/GraphicsLoaderIntf.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/GraphicsLoaderIntf.cpp


--------------------------------------------------------------------------------
/src/core/visual/ImageFunction.h:
--------------------------------------------------------------------------------
 1 | 
 2 | #ifndef ImageFunctionH
 3 | #define ImageFunctionH
 4 | 
 5 | #include "tjsNative.h"
 6 | #include "LayerIntf.h"
 7 | #include "LayerBitmapIntf.h"
 8 | #include "LayerBitmapImpl.h"
 9 | #include "ComplexRect.h"
10 | 
11 | class tTJSNI_ImageFunction : public tTJSNativeInstance
12 | {
13 | 	typedef tTJSNativeInstance inherited;
14 | 
15 | public:
16 | 	tTJSNI_ImageFunction();
17 | 	tjs_error TJS_INTF_METHOD
18 | 		Construct(tjs_int numparams, tTJSVariant **param,
19 | 			iTJSDispatch2 *tjs_obj);
20 | 	void TJS_INTF_METHOD Invalidate();
21 | };
22 | 
23 | 
24 | class tTJSNC_ImageFunction : public tTJSNativeClass
25 | {
26 | 	typedef tTJSNativeClass inherited;
27 | 
28 | public:
29 | 	tTJSNC_ImageFunction();
30 | 	static tjs_uint32 ClassID;
31 | 
32 | protected:
33 | 	tTJSNativeInstance *CreateNativeInstance();
34 | 
35 | 	static tTVPBBBltMethod GetBltMethodFromOperationMode( tTVPBlendOperationMode mode, tTVPDrawFace face );
36 | 	static bool ClipDestPointAndSrcRect(tjs_int &dx, tjs_int &dy, tTVPRect &srcrectout, const tTVPRect &srcrect, const tTVPRect &clipRect);
37 | };
38 | 
39 | extern tTJSNativeClass * TVPCreateNativeClass_ImageFunction();
40 | #endif // ImageFunctionH
41 | 


--------------------------------------------------------------------------------
/src/core/visual/LayerBitmapIntf.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/LayerBitmapIntf.cpp


--------------------------------------------------------------------------------
/src/core/visual/LayerBitmapIntf.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/LayerBitmapIntf.h


--------------------------------------------------------------------------------
/src/core/visual/LayerIntf.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/LayerIntf.cpp


--------------------------------------------------------------------------------
/src/core/visual/LayerManager.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/LayerManager.cpp


--------------------------------------------------------------------------------
/src/core/visual/LayerManager.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/LayerManager.h


--------------------------------------------------------------------------------
/src/core/visual/LayerTreeOwner.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/LayerTreeOwner.h


--------------------------------------------------------------------------------
/src/core/visual/LayerTreeOwnerImpl.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/LayerTreeOwnerImpl.cpp


--------------------------------------------------------------------------------
/src/core/visual/LayerTreeOwnerImpl.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/LayerTreeOwnerImpl.h


--------------------------------------------------------------------------------
/src/core/visual/LoadJPEG.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/LoadJPEG.cpp


--------------------------------------------------------------------------------
/src/core/visual/LoadJXR.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/LoadJXR.cpp


--------------------------------------------------------------------------------
/src/core/visual/LoadPNG.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/LoadPNG.cpp


--------------------------------------------------------------------------------
/src/core/visual/LoadTLG.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000-2007 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // TLG5/6 decoder
10 | //---------------------------------------------------------------------------
11 | 
12 | #ifndef LoadTLGH
13 | #define LoadTLGH
14 | 
15 | extern void TVPLoadTLG(void* formatdata, void *callbackdata, tTVPGraphicSizeCallback sizecallback,
16 | 	tTVPGraphicScanLineCallback scanlinecallback, tTVPMetaInfoPushCallback metainfopushcallback,
17 | 	tTJSBinaryStream *src, tjs_int keyidx, tTVPGraphicLoadMode mode);
18 | 
19 | 
20 | #endif
21 | 
22 | 


--------------------------------------------------------------------------------
/src/core/visual/PrerenderedFont.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/PrerenderedFont.h


--------------------------------------------------------------------------------
/src/core/visual/RenderManager_software.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include "RenderManager.h"
 3 | 
 4 | class tTVPRenderMethod_Software : public iTVPRenderMethod {
 5 | public:
 6 | 	virtual void DoRender(
 7 | 		iTVPTexture2D *_tar, const tTVPRect &rctar,
 8 | 		iTVPTexture2D *_dst, const tTVPRect &rcdst,
 9 | 		iTVPTexture2D *_src, const tTVPRect &rcsrc,
10 | 		iTVPTexture2D *rule, const tTVPRect &rcrule) = 0;
11 | };


--------------------------------------------------------------------------------
/src/core/visual/SaveTLG.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/SaveTLG.h


--------------------------------------------------------------------------------
/src/core/visual/SaveTLG6.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/SaveTLG6.cpp


--------------------------------------------------------------------------------
/src/core/visual/WindowIntf.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/WindowIntf.h


--------------------------------------------------------------------------------
/src/core/visual/argb.cpp:
--------------------------------------------------------------------------------
 1 | #include "argb.h"
 2 | 
 3 | template <>
 4 | void tTVPARGB<tjs_uint8>::Zero()
 5 | {
 6 | 	*(tjs_uint32 *)this = 0;
 7 | }
 8 | 
 9 | template <>
10 | void tTVPARGB<tjs_uint8>::operator = (tjs_uint32 v)
11 | {
12 | 	*(tjs_uint32 *)this = v;
13 | }
14 | 
15 | template <>
16 | tTVPARGB<tjs_uint8>::operator tjs_uint32() const
17 | {
18 | 	return *(const tjs_uint32 *)this;
19 | }
20 | 
21 | template <>
22 | void tTVPARGB<tjs_uint8>::average(tjs_int n)
23 | {
24 | 	tjs_int half_n = n >> 1;
25 | 
26 | 	tjs_int recip = (1L << 23) / n;
27 | 
28 | 	b = (b + half_n)*recip >> 23;
29 | 	g = (g + half_n)*recip >> 23;
30 | 	r = (r + half_n)*recip >> 23;
31 | 	a = (a + half_n)*recip >> 23;
32 | }
33 | 
34 | template <>
35 | void tTVPARGB<tjs_uint16>::average(tjs_int n)
36 | {
37 | 	tjs_int half_n = n >> 1;
38 | 
39 | 	tjs_int recip = (1L << 16) / n;
40 | 
41 | 	b = (b + half_n)*recip >> 16;
42 | 	g = (g + half_n)*recip >> 16;
43 | 	r = (r + half_n)*recip >> 16;
44 | 	a = (a + half_n)*recip >> 16;
45 | }
46 | 
47 | template <>
48 | void tTVPARGB<tjs_uint32>::average(tjs_int n)
49 | {
50 | 	tjs_int half_n = n >> 1;
51 | 
52 | 	b = (b + half_n) / n;
53 | 	g = (g + half_n) / n;
54 | 	r = (r + half_n) / n;
55 | 	a = (a + half_n) / n;
56 | }
57 | 
58 | // avoid bug for VC compiler
59 | void __argb_hack_for_vc() {
60 | 	tTVPARGB<tjs_uint8> a;
61 | 	a = 0;
62 | 	a.Zero();
63 | 	a.operator tjs_uint32();
64 | 	a.average(0);
65 | 	tTVPARGB<tjs_uint16> b;
66 | 	b.average(0);
67 | 	tTVPARGB<tjs_uint32> c;
68 | 	c.average(0);
69 | }
70 | 


--------------------------------------------------------------------------------
/src/core/visual/gl/ResampleImage.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/gl/ResampleImage.cpp


--------------------------------------------------------------------------------
/src/core/visual/gl/ResampleImage.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/gl/ResampleImage.h


--------------------------------------------------------------------------------
/src/core/visual/gl/ResampleImageInternal.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/gl/ResampleImageInternal.h


--------------------------------------------------------------------------------
/src/core/visual/gl/WeightFunctor.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/gl/WeightFunctor.cpp


--------------------------------------------------------------------------------
/src/core/visual/gl/WeightFunctor.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/gl/WeightFunctor.h


--------------------------------------------------------------------------------
/src/core/visual/gl/blend_function.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/gl/blend_function.cpp


--------------------------------------------------------------------------------
/src/core/visual/gl/blend_functor_c.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/gl/blend_functor_c.h


--------------------------------------------------------------------------------
/src/core/visual/gl/blend_util_func.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/gl/blend_util_func.h


--------------------------------------------------------------------------------
/src/core/visual/gl/blend_variation.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/gl/blend_variation.h


--------------------------------------------------------------------------------
/src/core/visual/gl/tvpgl_mathutil.h:
--------------------------------------------------------------------------------
 1 | /*
 2 | 
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000-2009 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | 
 8 | 
 9 | */
10 | 
11 | 
12 | #ifndef __TVP_MATH_UTIL_H__
13 | #define __TVP_MATH_UTIL_H__
14 | 
15 | /* fast_int_hypot from http://demo.and.or.jp/makedemo/effect/math/hypot/fast_hypot.c */
16 | static inline tjs_uint fast_int_hypot(tjs_int lx, tjs_int ly) {
17 | 	tjs_uint len1, len2,t,length;
18 | 	if(lx<0) lx = -lx;
19 | 	if(ly<0) ly = -ly;
20 | 	if (lx >= ly) { len1 = lx ; len2 = ly; }
21 | 	else { len1 = ly ; len2 = lx; }
22 | 	t = len2 + (len2 >> 1) ;
23 | 	length = len1 - (len1 >> 5) - (len1 >> 7) + (t >> 2) + (t >> 6) ;
24 | 	return length;
25 | }
26 | 
27 | #endif //__TVP_MATH_UTIL_H__
28 | 


--------------------------------------------------------------------------------
/src/core/visual/ogl/RenderManager_ogl.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/ogl/RenderManager_ogl.cpp


--------------------------------------------------------------------------------
/src/core/visual/ogl/astcrt.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include "stdint.h"
 3 | 
 4 | namespace ASTCRealTimeCodec {
 5 | 	// from https://github.com/daoo/astcrt
 6 | 
 7 | 	/**
 8 | 	* Compress an texture with the ASTC format.
 9 | 	*
10 | 	* @param src The source data, width*height*4 bytes with BGRA ordering.
11 | 	* @param dst The output, width*height bytes.
12 | 	* @param width The width of the input texture.
13 | 	* @param height The height of the input texture.
14 | 	*/
15 | 	void compress_texture_4x4(const uint8_t* src, uint8_t* dst, int width, int height);
16 | }
17 | 


--------------------------------------------------------------------------------
/src/core/visual/ogl/etcpak.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include <functional>
 3 | 
 4 | // from https://bitbucket.org/wolfpld/etcpak.git
 5 | 
 6 | namespace ETCPacker {
 7 | 	void* convert(const void *pixel, int w, int h, int pitch, bool etc2, size_t &datalen);
 8 | 	void* convertWithAlpha(const void *pixel, int w, int h, int pitch, size_t &datalen);
 9 | 	void decode(const void *data, void* pixel, int pitch, int h, int blkw, int blkh);
10 | 	void decodeWithAlpha(const void *data, void* pixel, int pitch, int h, int blkw, int blkh);
11 | }
12 | 


--------------------------------------------------------------------------------
/src/core/visual/ogl/ogl_common.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #ifdef WIN32 
 3 | #if defined(_M_X64)
 4 | #define GLEW_STATIC
 5 | #endif
 6 | #include "GL/glew.h"
 7 | #else
 8 | #ifndef GL_UNPACK_ROW_LENGTH
 9 | #define GL_UNPACK_ROW_LENGTH 0x0CF2
10 | #endif
11 | #ifdef __APPLE__
12 | #include <OpenGLES/ES2/gl.h>
13 | #include <OpenGLES/ES2/glext.h>
14 | #else
15 | #include <GLES2/gl2.h>
16 | #include <GLES2/gl2ext.h>
17 | #include <EGL/egl.h>
18 | #endif
19 | #endif
20 | 
21 | bool TVPCheckGLExtension(const std::string &extname);
22 | 


--------------------------------------------------------------------------------
/src/core/visual/ogl/pvr.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include <stdint.h>
 3 | 
 4 | #pragma pack(push, 1)
 5 | struct PVRv3Header
 6 | {
 7 | 	uint32_t version;
 8 | 	uint32_t flags;
 9 | 	uint64_t pixelFormat;
10 | 	uint32_t colorSpace;
11 | 	uint32_t channelType;
12 | 	uint32_t height;
13 | 	uint32_t width;
14 | 	uint32_t depth;
15 | 	uint32_t numberOfSurfaces;
16 | 	uint32_t numberOfFaces;
17 | 	uint32_t numberOfMipmaps;
18 | 	uint32_t metadataLength;
19 | };
20 | enum class PVR3TexturePixelFormat : uint64_t
21 | {
22 | 	PVRTC2BPP_RGB = 0ULL,
23 | 	PVRTC2BPP_RGBA = 1ULL,
24 | 	PVRTC4BPP_RGB = 2ULL,
25 | 	PVRTC4BPP_RGBA = 3ULL,
26 | 	PVRTC2_2BPP_RGBA = 4ULL,
27 | 	PVRTC2_4BPP_RGBA = 5ULL,
28 | 	ETC1 = 6ULL,
29 | 	DXT1 = 7ULL,
30 | 	DXT2 = 8ULL,
31 | 	DXT3 = 9ULL,
32 | 	DXT4 = 10ULL,
33 | 	DXT5 = 11ULL,
34 | 	BC1 = 7ULL,
35 | 	BC2 = 9ULL,
36 | 	BC3 = 11ULL,
37 | 	BC4 = 12ULL,
38 | 	BC5 = 13ULL,
39 | 	BC6 = 14ULL,
40 | 	BC7 = 15ULL,
41 | 	UYVY = 16ULL,
42 | 	YUY2 = 17ULL,
43 | 	BW1bpp = 18ULL,
44 | 	R9G9B9E5 = 19ULL,
45 | 	RGBG8888 = 20ULL,
46 | 	GRGB8888 = 21ULL,
47 | 	ETC2_RGB = 22ULL,
48 | 	ETC2_RGBA = 23ULL,
49 | 	ETC2_RGBA1 = 24ULL,
50 | 	EAC_R11_Unsigned = 25ULL,
51 | 	EAC_R11_Signed = 26ULL,
52 | 	EAC_RG11_Unsigned = 27ULL,
53 | 	EAC_RG11_Signed = 28ULL,
54 | 
55 | 	BGRA8888 = 0x0808080861726762ULL,
56 | 	RGBA8888 = 0x0808080861626772ULL,
57 | 	RGBA4444 = 0x0404040461626772ULL,
58 | 	RGBA5551 = 0x0105050561626772ULL,
59 | 	RGB565 = 0x0005060500626772ULL,
60 | 	RGB888 = 0x0008080800626772ULL,
61 | 	A8 = 0x0000000800000061ULL,
62 | 	L8 = 0x000000080000006cULL,
63 | 	LA88 = 0x000008080000616cULL,
64 | };
65 | #pragma pack(pop)


--------------------------------------------------------------------------------
/src/core/visual/ogl/pvrtc.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | // from https://bitbucket.org/jthlim/pvrtccompressor
3 | namespace PvrTcEncoder {
4 | 	void EncodeRgba4Bpp(const void *inBuf, void *outBuffer, unsigned int width, unsigned int height, bool isOpaque);
5 | }


--------------------------------------------------------------------------------
/src/core/visual/tvpgl_asm_init.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | #include "cpu_types.h"
 3 | 
 4 | #ifdef __cplusplus
 5 | extern "C" {
 6 | #endif
 7 | 
 8 |     extern void TVPGL_ASM_Init();
 9 | 
10 | #ifdef __cplusplus
11 | }
12 | #endif
13 | 


--------------------------------------------------------------------------------
/src/core/visual/tvpps.inc:
--------------------------------------------------------------------------------
 1 | /*
 2 |   Photoshop-like layer blender for KIRIKIRI (C-version)
 3 |   (c)2004-2005 Kengo Takagi (Kenjo) <kenjo@ceres.dti.ne.jp>
 4 | 
 5 |   Include file for function macro expansion (see also tvpps.c)
 6 | */
 7 | 
 8 | /* ------------------------------ */
 9 | #define OPERATION1 { TVPPS_REG tjs_uint32 s = *buf++, d = *dest, a = s>>24; TVPPS_OPERATION; *dest++ = s; }
10 | void __cdecl TVPPS_FUNC_NORM(tjs_uint32 *dest, const tjs_uint32 *buf, tjs_int len)
11 | {
12 | 	TVPPS_MAINLOOP
13 | }
14 | #undef OPERATION1
15 | /* ------------------------------ */
16 | #define OPERATION1 { TVPPS_REG tjs_uint32 s = *buf++, d = *dest, a = ((s>>24)*opa)>>8; TVPPS_OPERATION; *dest++ = s; }
17 | void __cdecl TVPPS_FUNC_O(tjs_uint32 *dest, const tjs_uint32 *buf, tjs_int len, tjs_int opa)
18 | {
19 | 	TVPPS_MAINLOOP
20 | }
21 | #undef OPERATION1
22 | /* ------------------------------ */
23 | #define OPERATION1 { TVPPS_REG tjs_uint32 s = *buf++, d = *dest, a = s>>24; TVPPS_OPERATION; *dest++ = s|(d&0xff000000); }
24 | void __cdecl TVPPS_FUNC_HDA(tjs_uint32 *dest, const tjs_uint32 *buf, tjs_int len)
25 | {
26 | 	TVPPS_MAINLOOP
27 | }
28 | #undef OPERATION1
29 | /* ------------------------------ */
30 | #define OPERATION1 { TVPPS_REG tjs_uint32 s = *buf++, d = *dest, a = ((s>>24)*opa)>>8; TVPPS_OPERATION; *dest++ = s|(d&0xff000000); }
31 | void __cdecl TVPPS_FUNC_HDA_O(tjs_uint32 *dest, const tjs_uint32 *buf, tjs_int len, tjs_int opa)
32 | {
33 | 	TVPPS_MAINLOOP
34 | }
35 | #undef OPERATION1
36 | 
37 | #undef TVPPS_FUNC_NORM
38 | #undef TVPPS_FUNC_O
39 | #undef TVPPS_FUNC_HDA
40 | #undef TVPPS_FUNC_HDA_O
41 | #undef TVPPS_OPERATION
42 | 


--------------------------------------------------------------------------------
/src/core/visual/voMode.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/voMode.h


--------------------------------------------------------------------------------
/src/core/visual/win32/BasicDrawDevice.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/win32/BasicDrawDevice.cpp


--------------------------------------------------------------------------------
/src/core/visual/win32/BasicDrawDevice.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/win32/BasicDrawDevice.h


--------------------------------------------------------------------------------
/src/core/visual/win32/BitmapBitsAlloc.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/win32/BitmapBitsAlloc.cpp


--------------------------------------------------------------------------------
/src/core/visual/win32/BitmapBitsAlloc.h:
--------------------------------------------------------------------------------
 1 | #ifndef __BITMAP_BITS_ALLOC_H__
 2 | #define __BITMAP_BITS_ALLOC_H__
 3 | #include <stdint.h>
 4 | 
 5 | //---------------------------------------------------------------------------
 6 | // memory allocation class
 7 | //---------------------------------------------------------------------------
 8 | class iTVPMemoryAllocator {
 9 | public:
10 | 	virtual ~iTVPMemoryAllocator() {};
11 | 	virtual void* allocate( size_t size ) = 0;
12 | 	virtual void free( void* mem ) = 0;
13 | };
14 | //---------------------------------------------------------------------------
15 | // heap allocation functions for bitmap bits
16 | //---------------------------------------------------------------------------
17 | class tTVPBitmapBitsAlloc {
18 | 	typedef intptr_t tTJSPointerSizedInteger;
19 | 	// this must be a integer type that has the same size with the normal
20 | 	// pointer ( void *)
21 | 	//---------------------------------------------------------------------------
22 | 	#pragma pack(push, 1)
23 | 	struct tTVPLayerBitmapMemoryRecord
24 | 	{
25 | 		void * alloc_ptr; // allocated pointer
26 | 		tjs_uint size; // original bmp bits size, in bytes
27 | 		tjs_uint32 sentinel_backup1; // sentinel value 1
28 | 		tjs_uint32 sentinel_backup2; // sentinel value 2
29 | 	};
30 | 	#pragma pack(pop)
31 | 	static iTVPMemoryAllocator* Allocator;
32 | 	static tTJSCriticalSection AllocCS;
33 | 	static void InitializeAllocator();
34 | 
35 | public:
36 | 	static void FreeAllocator();
37 | 	static void* Alloc( tjs_uint size, tjs_uint width, tjs_uint height );
38 | 	static void Free( void* ptr );
39 | };
40 | 
41 | #endif // __BITMAP_BITS_ALLOC_H__
42 | 
43 | 


--------------------------------------------------------------------------------
/src/core/visual/win32/BitmapInfomation.cpp:
--------------------------------------------------------------------------------
 1 | 
 2 | #include "tjsCommHead.h"
 3 | #include "BitmapInfomation.h"
 4 | #include "MsgIntf.h"
 5 | 
 6 | BitmapInfomation::BitmapInfomation( tjs_uint width, tjs_uint height, int bpp ) {
 7 | 	BitmapInfoSize = sizeof(TVPBITMAPINFOHEADER) + ((bpp == 8) ? sizeof(TVPRGBQUAD) * 256 : 0);
 8 | 	BitmapInfo = (TVPBITMAPINFO*)malloc(BitmapInfoSize);
 9 | 	if(!BitmapInfo) TVPThrowExceptionMessage(TVPCannotAllocateBitmapBits,
10 | 		TJS_W("allocating BITMAPINFOHEADER"), ttstr((tjs_int)BitmapInfoSize));
11 | 
12 | 	tjs_int PitchBytes;
13 | 	tjs_uint bitmap_width = width;
14 | 	// note that the allocated bitmap size can be bigger than the
15 | 	// original size because the horizontal pitch of the bitmap
16 | 	// is aligned to a paragraph (16bytes)
17 | 	if( bpp == 8 ) {
18 | 		bitmap_width = (((bitmap_width-1) / 16)+1) *16; // align to a paragraph
19 | 		PitchBytes = (((bitmap_width-1) >> 2)+1) <<2;
20 | 	} else {
21 | 		bitmap_width = (((bitmap_width-1) / 4)+1) *4; // align to a paragraph
22 | 		PitchBytes = bitmap_width * 4;
23 | 	}
24 | 	BitmapInfo->bmiHeader.biSize = sizeof(BitmapInfo->bmiHeader);
25 | 	BitmapInfo->bmiHeader.biWidth = bitmap_width;
26 | 	BitmapInfo->bmiHeader.biHeight = height;
27 | 	BitmapInfo->bmiHeader.biPlanes = 1;
28 | 	BitmapInfo->bmiHeader.biBitCount = bpp;
29 | 	BitmapInfo->bmiHeader.biCompression = /*BI_RGB*/0;
30 | 	BitmapInfo->bmiHeader.biSizeImage = PitchBytes * height;
31 | 	BitmapInfo->bmiHeader.biXPelsPerMeter = 0;
32 | 	BitmapInfo->bmiHeader.biYPelsPerMeter = 0;
33 | 	BitmapInfo->bmiHeader.biClrUsed = 0;
34 | 	BitmapInfo->bmiHeader.biClrImportant = 0;
35 | 
36 | 	// create grayscale palette
37 | 	if(bpp == 8) {
38 | 		TVPRGBQUAD *pal = (TVPRGBQUAD*)((tjs_uint8*)BitmapInfo + sizeof(TVPBITMAPINFOHEADER));
39 | 		for( tjs_int i=0; i<256; i++ ) {
40 | 			pal[i].rgbBlue = pal[i].rgbGreen = pal[i].rgbRed = (tjs_uint8)i;
41 | 			pal[i].rgbReserved = 0;
42 | 		}
43 | 	}
44 | }
45 | 
46 | BitmapInfomation::~BitmapInfomation() {
47 | 	free(BitmapInfo);
48 | 	BitmapInfo = NULL;
49 | }
50 | 
51 | 


--------------------------------------------------------------------------------
/src/core/visual/win32/BitmapInfomation.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/win32/BitmapInfomation.h


--------------------------------------------------------------------------------
/src/core/visual/win32/DInputMgn.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/win32/DInputMgn.cpp


--------------------------------------------------------------------------------
/src/core/visual/win32/GDIFontRasterizer.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/win32/GDIFontRasterizer.cpp


--------------------------------------------------------------------------------
/src/core/visual/win32/GDIFontRasterizer.h:
--------------------------------------------------------------------------------
 1 | 
 2 | #ifndef __GDI_FONT_RASTERIZER_H__
 3 | #define __GDI_FONT_RASTERIZER_H__
 4 | 
 5 | #include "tjsCommHead.h"
 6 | #include "CharacterData.h"
 7 | #include "FontRasterizer.h"
 8 | 
 9 | class GDIFontRasterizer : public FontRasterizer {
10 | 	tjs_int RefCount;
11 | 	class tTVPSysFont* FontDC;
12 | 	class tTVPSysFont* NonBoldFontDC;
13 | 	class tTVPNativeBaseBitmap* LastBitmap;
14 | 	LOGFONT CurentLOGFONT;
15 | 
16 | 	bool ChUseResampling; // whether to use resampling anti-aliasing
17 | 	bool ChAntialiasMethodInit;
18 | 	
19 | 	enum tTVPChAntialiasMethod
20 | 	{	camAPI,	camResample4, camResample8, camSubpixelRGB, camSubpixelBGR };
21 | 	tTVPChAntialiasMethod ChAntialiasMethod;
22 | 
23 | 	void InitChAntialiasMethod();
24 | public:
25 | 	GDIFontRasterizer();
26 | 	virtual ~GDIFontRasterizer();
27 | 	void AddRef();
28 | 	void Release();
29 | 	void ApplyFont( class tTVPNativeBaseBitmap *bmp, bool force );
30 | 	void ApplyFont( const struct tTVPFont& font );
31 | 	void GetTextExtent(tjs_char ch, tjs_int &w, tjs_int &h);
32 | 	tjs_int GetAscentHeight();
33 | 	class tTVPCharacterData* GetBitmap( const struct tTVPFontAndCharacterData & font, tjs_int aofsx, tjs_int aofsy );
34 | 	void GetGlyphDrawRect( const ttstr & text, struct tTVPRect& area );
35 | };
36 | 
37 | #endif // __GDI_FONT_RASTERIZER_H__
38 | 


--------------------------------------------------------------------------------
/src/core/visual/win32/LayerBitmapImpl.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/win32/LayerBitmapImpl.cpp


--------------------------------------------------------------------------------
/src/core/visual/win32/LayerBitmapImpl.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/win32/LayerBitmapImpl.h


--------------------------------------------------------------------------------
/src/core/visual/win32/LayerImpl.h:
--------------------------------------------------------------------------------
 1 | //---------------------------------------------------------------------------
 2 | /*
 3 | 	TVP2 ( T Visual Presenter 2 )  A script authoring tool
 4 | 	Copyright (C) 2000 W.Dee <dee@kikyou.info> and contributors
 5 | 
 6 | 	See details of license at "license.txt"
 7 | */
 8 | //---------------------------------------------------------------------------
 9 | // Layer Management
10 | //---------------------------------------------------------------------------
11 | #ifndef LayerImplH
12 | #define LayerImplH
13 | 
14 | 
15 | #include "LayerIntf.h"
16 | //---------------------------------------------------------------------------
17 | // tTJSNI_Layer
18 | //---------------------------------------------------------------------------
19 | class tTJSNI_Layer : public tTJSNI_BaseLayer
20 | {
21 | public:
22 | 	tTJSNI_Layer(void);
23 | 	~tTJSNI_Layer();
24 | 	tjs_error TJS_INTF_METHOD Construct(tjs_int numparams, tTJSVariant **param,
25 | 		iTJSDispatch2 *tjs_obj);
26 | 	void TJS_INTF_METHOD Invalidate();
27 | 	static tTJSNI_Layer* FromVariant(const tTJSVariant& var);
28 | 	static tTJSNI_Layer* FromObject(iTJSDispatch2* obj);
29 | 	//HRGN CreateMaskRgn(tjs_uint threshold);
30 | };
31 | //---------------------------------------------------------------------------
32 | #endif
33 | 


--------------------------------------------------------------------------------
/src/core/visual/win32/MenuItemImpl.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/win32/MenuItemImpl.cpp


--------------------------------------------------------------------------------
/src/core/visual/win32/NativeFreeTypeFace.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/win32/NativeFreeTypeFace.cpp


--------------------------------------------------------------------------------
/src/core/visual/win32/NativeFreeTypeFace.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/win32/NativeFreeTypeFace.h


--------------------------------------------------------------------------------
/src/core/visual/win32/PassThroughDrawDevice.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/win32/PassThroughDrawDevice.h


--------------------------------------------------------------------------------
/src/core/visual/win32/TVPColor.h:
--------------------------------------------------------------------------------
 1 | 
 2 | #ifndef __TVP_COLOR_H__
 3 | #define __TVP_COLOR_H__
 4 | 
 5 | enum {
 6 | 	clScrollBar = 0x80000000,
 7 | 	clBackground = 0x80000001,
 8 | 	clActiveCaption = 0x80000002,
 9 | 	clInactiveCaption = 0x80000003,
10 | 	clMenu = 0x80000004,
11 | 	clWindow = 0x80000005,
12 | 	clWindowFrame = 0x80000006,
13 | 	clMenuText = 0x80000007,
14 | 	clWindowText = 0x80000008,
15 | 	clCaptionText = 0x80000009,
16 | 	clActiveBorder = 0x8000000a,
17 | 	clInactiveBorder = 0x8000000b,
18 | 	clAppWorkSpace = 0x8000000c,
19 | 	clHighlight = 0x8000000d,
20 | 	clHighlightText = 0x8000000e,
21 | 	clBtnFace = 0x8000000f,
22 | 	clBtnShadow = 0x80000010,
23 | 	clGrayText = 0x80000011,
24 | 	clBtnText = 0x80000012,
25 | 	clInactiveCaptionText = 0x80000013,
26 | 	clBtnHighlight = 0x80000014,
27 | 	cl3DDkShadow = 0x80000015,
28 | 	cl3DLight = 0x80000016,
29 | 	clInfoText = 0x80000017,
30 | 	clInfoBk = 0x80000018,
31 | 	clNone = 0x1fffffff,
32 | 	clAdapt= 0x01ffffff,
33 | 	clPalIdx = 0x3000000,
34 | 	clAlphaMat = 0x4000000,
35 | 	clUnknown = 0x80000019,
36 | 	clHotLight = 0x8000001a,
37 | 	clGradientActiveCaption = 0x8000001b,
38 | 	clGradientInactiveCaption = 0x8000001c,
39 | 	clMenuLight = 0x8000001d,
40 | 	clMenuBar = 0x8000001e,
41 | };
42 | 
43 | unsigned long ColorToRGB(unsigned int col);
44 | 
45 | #endif
46 | 
47 | 


--------------------------------------------------------------------------------
/src/core/visual/win32/TVPScreen.cpp:
--------------------------------------------------------------------------------
 1 | #include "cocos2d.h"
 2 | #include "tjsCommHead.h"
 3 | 
 4 | #include "TVPScreen.h"
 5 | #include "Application.h"
 6 | 
 7 | int tTVPScreen::GetWidth() {
 8 | 	return 2048;
 9 | }
10 | int tTVPScreen::GetHeight() {
11 | 	const cocos2d::Size &size = cocos2d::Director::getInstance()->getOpenGLView()->getFrameSize();
12 | 	int w = GetWidth();
13 | 	int h = w * (size.height / size.width);
14 | 	return w;
15 | }
16 | 
17 | int tTVPScreen::GetDesktopLeft() {
18 | 	return 0;
19 | }
20 | int tTVPScreen::GetDesktopTop() {
21 | 	return 0;
22 | }
23 | int tTVPScreen::GetDesktopWidth() {
24 | 	return GetWidth();
25 | }
26 | int tTVPScreen::GetDesktopHeight() {
27 | 	return GetHeight();
28 | }
29 | 
30 | 


--------------------------------------------------------------------------------
/src/core/visual/win32/TVPScreen.h:
--------------------------------------------------------------------------------
 1 | 
 2 | #ifndef __TVP_SCREEN_H__
 3 | #define __TVP_SCREEN_H__
 4 | class tTVPScreen {
 5 | public:
 6 | 	tTVPScreen();
 7 | 	static int GetWidth();
 8 | 	static int GetHeight();
 9 | //	static void GetDesktopRect( RECT& r );
10 | 	static int GetDesktopLeft();
11 | 	static int GetDesktopTop();
12 | 	static int GetDesktopWidth();
13 | 	static int GetDesktopHeight();
14 | };
15 | 
16 | #endif // __TVP_SCREEN_H__
17 | 


--------------------------------------------------------------------------------
/src/core/visual/win32/TVPSysFont.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/win32/TVPSysFont.cpp


--------------------------------------------------------------------------------
/src/core/visual/win32/TVPSysFont.h:
--------------------------------------------------------------------------------
 1 | #ifndef __TVP_SYS_FONT_H__
 2 | #define __TVP_SYS_FONT_H__
 3 | 
 4 | class tTVPSysFont {
 5 | // 	HFONT hFont_;
 6 | // 	HFONT hOldFont_;
 7 | // 	HDC hMemDC_;
 8 | // 	HBITMAP hBmp_;
 9 | // 	HBITMAP hOldBmp_;
10 | 
11 | private:
12 | 	void InitializeMemDC();
13 | 
14 | public:
15 | 	tTVPSysFont();
16 | 	tTVPSysFont( const tTVPFont &font );
17 | 	~tTVPSysFont();
18 | 
19 | 	int GetAscentHeight();
20 | 	void Assign( const tTVPSysFont* font );
21 | 	void Assign( const tTVPFont &font );
22 | // 	void ApplyFont( const LOGFONT* info );
23 | // 	void GetFont( LOGFONT* font ) const;
24 | // 	HDC GetDC() { return hMemDC_; }
25 | };
26 | 
27 | extern void TVPGetAllFontList(std::vector<ttstr>& list);
28 | extern void TVPGetFontList(std::vector<ttstr> & list, tjs_uint32 flags, const tTVPFont & font);
29 | extern tjs_uint8 TVPGetCharSetFromFaceName( const tjs_char* face );
30 | #endif // __TVP_SYS_FONT_H__
31 | 


--------------------------------------------------------------------------------
/src/core/visual/win32/VSyncTimingThread.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/win32/VSyncTimingThread.cpp


--------------------------------------------------------------------------------
/src/core/visual/win32/VSyncTimingThread.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/win32/VSyncTimingThread.h


--------------------------------------------------------------------------------
/src/core/visual/win32/VideoOvlImpl.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/win32/VideoOvlImpl.cpp


--------------------------------------------------------------------------------
/src/core/visual/win32/VideoOvlImpl.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/win32/VideoOvlImpl.h


--------------------------------------------------------------------------------
/src/core/visual/win32/WindowImpl.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/win32/WindowImpl.cpp


--------------------------------------------------------------------------------
/src/core/visual/win32/WindowImpl.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/core/visual/win32/WindowImpl.h


--------------------------------------------------------------------------------
/src/plugins/Android.mk:
--------------------------------------------------------------------------------
 1 | LOCAL_PATH := $(call my-dir)
 2 | 
 3 | include $(CLEAR_VARS)
 4 | 
 5 | LOCAL_MODULE := kr2plugin
 6 | 
 7 | LOCAL_SRC_FILES := \
 8 | $(wildcard $(LOCAL_PATH)/*.cpp) \
 9 | $(wildcard $(LOCAL_PATH)/*.c) \
10 | ncbind/ncbind.cpp \
11 | 
12 | LOCAL_SRC_FILES := $(LOCAL_SRC_FILES:$(LOCAL_PATH)/%=%)
13 | 
14 | LOCAL_C_INCLUDES += \
15 | $(LOCAL_PATH) \
16 | $(LOCAL_PATH)/ncbind \
17 | $(LOCAL_PATH)/../../vendor/freetype/current/include \
18 | $(LOCAL_PATH)/../core \
19 | $(LOCAL_PATH)/../core/base  \
20 | $(LOCAL_PATH)/../core/base/win32 \
21 | $(LOCAL_PATH)/../core/environ \
22 | $(LOCAL_PATH)/../core/environ/sdl \
23 | $(LOCAL_PATH)/../core/msg \
24 | $(LOCAL_PATH)/../core/msg/win32 \
25 | $(LOCAL_PATH)/../core/sound \
26 | $(LOCAL_PATH)/../core/sound/win32 \
27 | $(LOCAL_PATH)/../core/tjs2 \
28 | $(LOCAL_PATH)/../core/utils \
29 | $(LOCAL_PATH)/../core/utils/win32 \
30 | $(LOCAL_PATH)/../core/visual \
31 | $(LOCAL_PATH)/../core/visual/ARM \
32 | $(LOCAL_PATH)/../core/visual/win32 \
33 | $(LOCAL_PATH)/../plugins \
34 | $(LOCAL_PATH)/../../vendor/boost/current \
35 | $(LOCAL_PATH)/../../vendor/libiconv/current/include \
36 | $(LOCAL_PATH)/../../vendor/libgdiplus/src \
37 | $(LOCAL_PATH)/../../vendor/agg/current/include \
38 | $(LOCAL_PATH)/../../vendor/expat/current/lib \
39 | $(LOCAL_PATH)/../../vendor/openal/current/include \
40 | $(LOCAL_PATH)/../../libs/android/ffmpeg/include \
41 |     $(LOCAL_PATH)/../../vendor/cocos2d-x/current/external/jpeg/include/android \
42 | 				 
43 | #LOCAL_LDLIBS := -lGLESv1_CM -lz -llog
44 | LOCAL_CPPFLAGS := -fexceptions -std=c++11 -D__STDC_CONSTANT_MACROS -DTJS_TEXT_OUT_CRLF -fvisibility=hidden
45 | LOCAL_CFLAGS += -DTJS_TEXT_OUT_CRLF
46 | LOCAL_STATIC_LIBRARIES := cpufeatures
47 | 
48 | include $(BUILD_STATIC_LIBRARY)
49 | $(call import-module,android/cpufeatures)
50 | 


--------------------------------------------------------------------------------
/src/plugins/InternalPlugins.cpp:
--------------------------------------------------------------------------------
 1 | #include "ncbind/ncbind.hpp"
 2 | //extern void InitPlugin_CSVParser();
 3 | 
 4 | void TVPLoadInternalPlugins()
 5 | {
 6 |     ncbAutoRegister::AllRegist();
 7 | 	ncbAutoRegister::LoadModule(TJS_W("xp3filter.dll"));
 8 |     //InitPlugin_CSVParser();
 9 | }
10 | 
11 | void TVPUnloadInternalPlugins()
12 | {
13 |     ncbAutoRegister::AllUnregist();
14 | }
15 | 
16 | bool TVPLoadInternalPlugin(const ttstr &_name)
17 | {
18 | 	return ncbAutoRegister::LoadModule(TVPExtractStorageName(_name));
19 | }


--------------------------------------------------------------------------------
/src/plugins/LayerExBase.h:
--------------------------------------------------------------------------------
 1 | #ifndef __LayerExBase__
 2 | #define __LayerExBase__
 3 | 
 4 | //#include <windows.h>
 5 | //#include "tp_stub.h"
 6 | #include "tjsNative.h"
 7 | 
 8 | /**
 9 |  * レイヤ拡張 基本情報保持用ネイティブインスタンス。
10 |  */
11 | class NI_LayerExBase : public tTJSNativeInstance
12 | {
13 | protected:
14 | 	// レイヤから情報を取得するためのプロパティ
15 | 	// 少しでも高速化するためキャッシュしておく
16 | 	static iTJSDispatch2 * _leftProp;
17 | 	static iTJSDispatch2 * _topProp;
18 | 	static iTJSDispatch2 * _widthProp;
19 | 	static iTJSDispatch2 * _heightProp;
20 | 	static iTJSDispatch2 * _pitchProp;
21 | 	static iTJSDispatch2 * _bufferProp;
22 | 	static iTJSDispatch2 * _updateProp;
23 | 
24 | public:
25 | 	// レイヤ情報比較保持用
26 | 	tjs_int _width;
27 | 	tjs_int _height;
28 | 	tjs_int _pitch;
29 | 	unsigned char *_buffer;
30 | 
31 | public:
32 | 	// クラスID保持用
33 | 	static int classId;
34 | 	static void init(iTJSDispatch2 *layerobj);
35 | 	static void unInit();
36 | 	
37 | 	/**
38 | 	 * ネイティブオブジェクトの取得
39 | 	 * @param layerobj レイヤオブジェクト
40 | 	 * @return ネイティブオブジェクト
41 | 	 */
42 | 	static NI_LayerExBase *getNative(iTJSDispatch2 *objthis, bool create=true);
43 | 
44 | 	/**
45 | 	 * 再描画要請
46 | 	 * @param layerobj レイヤオブジェクト
47 | 	 */
48 | 	void redraw(iTJSDispatch2 *layerobj);
49 | 	
50 | 	/**
51 | 	 * グラフィックを初期化する
52 | 	 * レイヤのビットマップ情報が変更されている可能性があるので毎回チェックする。
53 | 	 * 変更されている場合は描画用のコンテキストを組みなおす
54 | 	 * @param layerobj レイヤオブジェクト
55 | 	 * @return 初期化実行された場合は true を返す
56 | 	 */
57 | 	void reset(iTJSDispatch2 *layerobj);
58 | 	
59 | public:
60 | 	/**
61 | 	 * コンストラクタ
62 | 	 */
63 | 	NI_LayerExBase();
64 | };
65 | 
66 | #endif
67 | 


--------------------------------------------------------------------------------
/src/plugins/PluginStub.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | //#define __TP_STUB_H__
 3 | #include "tjsCommHead.h"
 4 | #include "StorageImpl.h"
 5 | #include "tjsNative.h"
 6 | #include "ScriptMgnIntf.h"
 7 | #include "tjsArray.h"
 8 | #include "tjsDictionary.h"
 9 | #include "DebugIntf.h"
10 | #include "TextStream.h"
11 | #include "MsgIntf.h"
12 | //#include "PluginImpl.h"
13 | #include "CharacterSet.h"
14 | 


--------------------------------------------------------------------------------
/src/plugins/addFont.cpp:
--------------------------------------------------------------------------------
 1 | #include "ncbind/ncbind.hpp"
 2 | 
 3 | #include <vector>
 4 | #include "FontImpl.h"
 5 | using namespace std;
 6 | 
 7 | #define NCB_MODULE_NAME TJS_W("addFont.dll")
 8 | 
 9 | struct FontEx
10 | {
11 | 	/**
12 | 	 * プライベートフォントの追加
13 | 	 * @param fontFileName フォントファイル名
14 | 	 * @param extract アーカイブからテンポラリ展開する
15 | 	 * @return void:ファイルを開くのに失敗 0:フォント登録に失敗 数値:登録したフォントの数
16 | 	 */
17 | 	static tjs_error TJS_INTF_METHOD addFont(tTJSVariant *result,
18 | 											 tjs_int numparams,
19 | 											 tTJSVariant **param,
20 | 											 iTJSDispatch2 *objthis) {
21 | 		if (numparams < 1) return TJS_E_BADPARAMCOUNT;
22 | 
23 | 		ttstr filename = TVPGetPlacedPath(*param[0]);
24 | 		if (filename.length()) {
25 | 			int ret = TVPEnumFontsProc(filename);
26 | 			if (result) {
27 | 				*result = (int)ret;
28 | 			}
29 | 			return TJS_S_OK;
30 | 		}
31 | 		return TJS_S_OK;
32 | 	}
33 | };
34 | 
35 | // フックつきアタッチ
36 | NCB_ATTACH_CLASS(FontEx, System) {
37 | 	RawCallback("addFont", &FontEx::addFont, TJS_STATICMEMBER);
38 | }
39 | 


--------------------------------------------------------------------------------
/src/plugins/csvParser.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/plugins/csvParser.cpp


--------------------------------------------------------------------------------
/src/plugins/fftgraph.cpp:
--------------------------------------------------------------------------------
 1 | #include "ncbind/ncbind.hpp"
 2 | 
 3 | #define NCB_MODULE_NAME TJS_W("fftgraph.dll")
 4 | 
 5 | static void InitPlugin()
 6 | {
 7 | 	TVPExecuteScript(TJS_W("function drawFFTGraph(){}"));
 8 | }
 9 | 
10 | NCB_PRE_REGIST_CALLBACK(InitPlugin);
11 | 


--------------------------------------------------------------------------------
/src/plugins/getabout.cpp:
--------------------------------------------------------------------------------
1 | #include "ncbind/ncbind.hpp"
2 | #include "MsgIntf.h"
3 | 
4 | #define NCB_MODULE_NAME TJS_W("getabout.dll")
5 | NCB_ATTACH_FUNCTION(getAboutString, System, TVPGetAboutString);
6 | 


--------------------------------------------------------------------------------
/src/plugins/ncbind/ncbind.cpp:
--------------------------------------------------------------------------------
 1 | #include "ncbind.hpp"
 2 | #include <set>
 3 | 
 4 | //---------------------------------------------------------------------------
 5 | // static変数の実体
 6 | 
 7 | // auto register 先頭ポインタ
 8 | ncbAutoRegister::ThisClassT const*
 9 | ncbAutoRegister::_top[ncbAutoRegister::LINE_COUNT] = NCB_INNER_AUTOREGISTER_LINES_INSTANCE;
10 | 
11 | std::set<ttstr> TVPRegisteredPlugins;
12 | 
13 | std::map<ttstr, ncbAutoRegister::INTERNAL_PLUGIN_LISTS > ncbAutoRegister::_internal_plugins;
14 | 
15 | bool ncbAutoRegister::LoadModule(const ttstr &_name)
16 | {
17 | 	ttstr name = _name.AsLowerCase();
18 | 	if (TVPRegisteredPlugins.find(name) != TVPRegisteredPlugins.end())
19 | 		return false;
20 | 	auto it = _internal_plugins.find(name);
21 | 	if (it != _internal_plugins.end()) {
22 | 		for (int line = 0; line < ncbAutoRegister::LINE_COUNT; ++line) {
23 | 			const std::list<ncbAutoRegister const*> &plugin_list = it->second.lists[line];
24 | 			for (auto i = plugin_list.begin(); i != plugin_list.end(); ++i) {
25 | 				(*i)->Regist();
26 | 			}
27 | 		}
28 | 		TVPRegisteredPlugins.insert(name);
29 | 		return true;
30 | 	}
31 | 	return false;
32 | }


--------------------------------------------------------------------------------
/src/plugins/saveStruct.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zeas2/Kirikiroid2/d1c2b1259423542c893e0b65eaeb46c848848f2b/src/plugins/saveStruct.cpp


--------------------------------------------------------------------------------
/src/plugins/tp_stub.h:
--------------------------------------------------------------------------------
 1 | #pragma once
 2 | //#define __TP_STUB_H__
 3 | #include "tjsCommHead.h"
 4 | #include "tjsNative.h"
 5 | #include "ScriptMgnIntf.h"
 6 | #include "tjsArray.h"
 7 | #include "tjsDictionary.h"
 8 | #include "DebugIntf.h"
 9 | #include "StorageImpl.h"
10 | #include "TextStream.h"
11 | #include "MsgIntf.h"
12 | #include "PluginImpl.h"
13 | #include "CharacterSet.h"
14 | #include "TransIntf.h"
15 | 


--------------------------------------------------------------------------------
/src/plugins/win32dialog.cpp:
--------------------------------------------------------------------------------
 1 | 
 2 | #include "ncbind/ncbind.hpp"
 3 | 
 4 | #define NCB_MODULE_NAME TJS_W("win32dialog.dll")
 5 | 
 6 | static void InitPlugin_WIN32Dialog()
 7 | {
 8 | 	TVPExecuteScript(
 9 | 		TJS_W("class WIN32Dialog {")
10 | 		TJS_W("	function messageBox(message, caption, type) {return !System.inform(message, caption, 2);}")
11 | 		TJS_W("}")
12 | 		);
13 | }
14 | 
15 | NCB_PRE_REGIST_CALLBACK(InitPlugin_WIN32Dialog);
16 | 


--------------------------------------------------------------------------------