📄 bak
字号:
public void pause()
{
}
protected void hideNotify()
{
}
protected void showNotify()
{
}
// Destroys the thread
public void destroy()
{
Minesweeper.s_midlet.destroyApp(true);
}
public void run()
{
while( true )
{
}
}
//------------------------------------------------------------
static int RECORD_SIZE = 1024;
static String RECORD_FILENAME = "Minesweeper";
static byte s_recordData[] = new byte[RECORD_SIZE];
public static void RecordStore(boolean save)
{
try
{
RecordStore rs = RecordStore.openRecordStore(RECORD_FILENAME, true);
if (rs.getNumRecords() <= 0)
{
if (save)
{
rs.addRecord(s_recordData, 0, RECORD_SIZE);
}
else
{
rs.closeRecordStore();
return;
}
}
else if (save)
{
rs.setRecord(1, s_recordData, 0, RECORD_SIZE);
}
else
{
rs.getRecord(1, s_recordData, 0);
}
rs.closeRecordStore();
rs = null;
}
catch (Exception e)
{
}
}
//----------------------------------------------------
private static javax.microedition.media.Player s_sound; //gl
private static int s_curSoundId = -1;
private static int SOUND_MAX = 2;
private static byte [][] s_soundData;
private static boolean s_isPlayMid = false;
public static boolean s_soundOn = false;
private static void LoadSound()
{
try
{
// pack_open(DATA.PACK_SOUND);
s_soundData = new byte[SOUND_MAX][];
for( int i=0; i<SOUND_MAX; i ++ )
{
// s_soundData[i] = pack_readData(i);
}
// pack_close();
}
catch(Exception e) { e.printStackTrace(); }
}
public static void PlaySoundLoop(int id, int loop)
{
if( !s_soundOn || id<0 || s_soundData[id]==null )
return;
StopSound(); // stop last midi
try
{
InputStream is = new ByteArrayInputStream( s_soundData[id] );
s_sound = javax.microedition.media.Manager.createPlayer(is, "audio/midi");
s_sound.realize();
s_sound.setLoopCount( loop );
s_sound.start();
s_curSoundId = id;
}
catch (Exception e) { e.printStackTrace(); }
}
public static void PlaySound(int id)
{
PlaySoundLoop(id,1);
}
public static void StopSound()
{
try
{
if( s_sound == null )
return;
else
{
s_sound.close();
s_sound = null;
}
}
catch ( Exception e ) { e.printStackTrace(); }
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -