Skip to content

Commit

Permalink
调整工程结构
Browse files Browse the repository at this point in the history
  • Loading branch information
ctiao committed Nov 15, 2013
1 parent 47792cf commit 9b10948
Show file tree
Hide file tree
Showing 50 changed files with 4,029 additions and 2,458 deletions.
15 changes: 1 addition & 14 deletions DanmakuFlameMaster/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,9 @@
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:largeHeap="true"
>
<activity
android:name="master.flame.danmaku.ui.activity.MainActivity"
android:label="@string/app_name"
android:screenOrientation="landscape"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>

</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,8 @@ public CacheManagingDrawTask(DanmakuTimer timer, Context context, int dispW, int

@Override
public void prepare() {
if (mParser == null) {
// load from testing danmaku file
loadDanmakus(mContext, mTimer);
} else {
loadDanmakus(mParser);
}
assert (mParser != null);
loadDanmakus(mParser);
mCacheManager.begin();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
/*
* Copyright (C) 2013 Chen Hui <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package master.flame.danmaku.controller;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff;

public class DrawHelper {

public static Paint paint;
static {
paint = new Paint();
paint.setColor(Color.RED);
paint.setTextSize(50);
//paint.setAntiAlias(true);
}

public static void drawText(Canvas canvas, String text) {

canvas.drawText(text, 10, canvas.getHeight() - 50, paint);

}

public static void drawDuration(Canvas canvas, String text) {
canvas.drawText(text, 100, 100, paint);
}

public static void drawCircle(float cx, float cy, Canvas canvas) {
canvas.drawCircle(cx, cy, 50, paint);
}

public static void clearCanvas(Canvas canvas) {
canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR);
}
}
/*
* Copyright (C) 2013 Chen Hui <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package master.flame.danmaku.controller;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff;

public class DrawHelper {

public static Paint paint;
static {
paint = new Paint();
paint.setColor(Color.RED);
paint.setTextSize(50);
//paint.setAntiAlias(true);
}

public static void drawText(Canvas canvas, String text) {

canvas.drawText(text, 10, canvas.getHeight() - 50, paint);

}

public static void drawDuration(Canvas canvas, String text) {
canvas.drawText(text, 100, 100, paint);
}

public static void drawCircle(float cx, float cy, Canvas canvas) {
canvas.drawCircle(cx, cy, 50, paint);
}

public static void clearCanvas(Canvas canvas) {
canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ public class DrawTask implements IDrawTask {

AndroidCounter mCounter;

private ILoader mLoader;
// private ILoader mLoader;

private IDataSource dataSource;
// private IDataSource dataSource;

protected BaseDanmakuParser mParser;

Expand All @@ -89,12 +89,8 @@ public void setParser(BaseDanmakuParser parser){
}

public void prepare(){
if (mParser == null) {
// load from testing danmaku file
loadDanmakus(mContext, mTimer);
} else {
loadDanmakus(mParser);
}
assert (mParser != null);
loadDanmakus(mParser);
if (mTaskListener != null) {
mTaskListener.ready();
}
Expand All @@ -105,10 +101,10 @@ protected void initTimer(DanmakuTimer timer) {
}

protected void loadDanmakus(BaseDanmakuParser parser) {
danmakuList = parser.setTimer(mTimer).parse();
danmakuList = parser.setDisp(mDisp).setTimer(mTimer).parse();
}

protected void loadDanmakus(Context context, DanmakuTimer timer) {
/* protected void loadDanmakus(Context context, DanmakuTimer timer) {
try {
if (DEBUG_OPTION == 0) {
loadAcDanmakus(context.getAssets().open("comment.json"), timer);
Expand Down Expand Up @@ -145,7 +141,7 @@ private void loadAcDanmakus(InputStream stream, DanmakuTimer timer) {
} catch (IllegalDataException e) {
Log.e(TAG, "load error", e);
}
}
}*/

@Override
public void draw(Canvas canvas) {
Expand Down
Loading

0 comments on commit 9b10948

Please sign in to comment.