mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-15 02:29:51 +01:00
Logspam reductions
This commit is contained in:
1 parent
bd44241558
commit
d0d5be2c5d
6 files changed
+38
-43
No files matched your search
+12
-20
@@ -146,7 +146,7 @@ extern "C" void Java_com_henrikrydgard_libnative_NativeApp_audioConfig
|
||||
|
||||
extern "C" void Java_com_henrikrydgard_libnative_NativeApp_init
|
||||
(JNIEnv *env, jclass, jint dpi, jstring jdevicetype, jstring jlangRegion, jstring japkpath,
|
||||
jstring jdataDir, jstring jexternalDir, jstring jlibraryDir, jstring jinstallID, jboolean juseNativeAudio) {
|
||||
jstring jdataDir, jstring jexternalDir, jstring jlibraryDir, jstring jinstallID, jboolean juseNativeAudio) {
|
||||
jniEnvUI = env;
|
||||
|
||||
ILOG("NativeApp.init() -- begin");
|
||||
@@ -165,7 +165,6 @@ extern "C" void Java_com_henrikrydgard_libnative_NativeApp_init
|
||||
hat_joystick_y_async = 0;
|
||||
|
||||
std::string apkPath = GetJavaString(env, japkpath);
|
||||
ILOG("NativeApp::Init: APK path: %s", apkPath.c_str());
|
||||
VFSRegister("", new ZipAssetReader(apkPath.c_str(), "assets/"));
|
||||
|
||||
systemName = GetJavaString(env, jdevicetype);
|
||||
@@ -197,14 +196,14 @@ extern "C" void Java_com_henrikrydgard_libnative_NativeApp_init
|
||||
}
|
||||
|
||||
extern "C" void Java_com_henrikrydgard_libnative_NativeApp_audioInit(JNIEnv *, jclass) {
|
||||
ILOG("NativeApp.audioInit() -- begin");
|
||||
if (use_opensl_audio) {
|
||||
// TODO: PPSSPP doesn't support 48khz yet so let's not use that yet.
|
||||
ILOG("Using OpenSL audio! frames/buffer: %i optimal sr: %i actual sr: 44100", optimalFramesPerBuffer, optimalSampleRate);
|
||||
ILOG("NativeApp.audioInit() -- Using OpenSL audio! frames/buffer: %i optimal sr: %i actual sr: 44100", optimalFramesPerBuffer, optimalSampleRate);
|
||||
optimalSampleRate = 44100;
|
||||
AndroidAudio_Init(&NativeMix, library_path, optimalFramesPerBuffer, optimalSampleRate);
|
||||
} else {
|
||||
ILOG("NativeApp.audioInit() -- Using Java audio :(");
|
||||
}
|
||||
ILOG("NativeApp.audioInit() -- end");
|
||||
}
|
||||
|
||||
extern "C" void Java_com_henrikrydgard_libnative_NativeApp_audioShutdown(JNIEnv *, jclass) {
|
||||
@@ -233,7 +232,6 @@ extern "C" void Java_com_henrikrydgard_libnative_NativeApp_pause(JNIEnv *, jclas
|
||||
extern "C" void Java_com_henrikrydgard_libnative_NativeApp_shutdown(JNIEnv *, jclass) {
|
||||
ILOG("NativeApp.shutdown() -- begin");
|
||||
NativeShutdown();
|
||||
ILOG("VFSShutdown.");
|
||||
VFSShutdown();
|
||||
net::Shutdown();
|
||||
ILOG("NativeApp.shutdown() -- end");
|
||||
@@ -250,22 +248,19 @@ extern "C" void Java_com_henrikrydgard_libnative_NativeRenderer_displayInit(JNIE
|
||||
dp_xres = pixel_xres * g_dpi_scale;
|
||||
dp_yres = pixel_yres * g_dpi_scale;
|
||||
|
||||
ILOG("Calling NativeInitGraphics(): dpi = %i, dp_xres = %i, dp_yres = %i", g_dpi, dp_xres, dp_yres);
|
||||
NativeInitGraphics();
|
||||
ILOG("NativeInitGraphics() completed");
|
||||
ILOG("NativeInitGraphics() completed: dpi = %i, dp_xres = %i, dp_yres = %i", g_dpi, dp_xres, dp_yres);
|
||||
|
||||
dp_xscale = (float)dp_xres / pixel_xres;
|
||||
dp_yscale = (float)dp_yres / pixel_yres;
|
||||
renderer_inited = true;
|
||||
} else {
|
||||
ILOG("Calling NativeDeviceLost();");
|
||||
NativeDeviceLost();
|
||||
ILOG("NativeDeviceLost completed.;");
|
||||
ILOG("NativeDeviceLost completed.");
|
||||
}
|
||||
ILOG("(Re)-fetching method ID to postCommand...");
|
||||
DLOG("(Re)-fetching method ID to postCommand...");
|
||||
jclass cls = env->GetObjectClass(obj);
|
||||
postCommand = env->GetMethodID(cls, "postCommand", "(Ljava/lang/String;Ljava/lang/String;)V");
|
||||
ILOG("MethodID: %i", (int)postCommand);
|
||||
}
|
||||
|
||||
extern "C" void Java_com_henrikrydgard_libnative_NativeRenderer_displayResize(JNIEnv *, jobject clazz, jint w, jint h) {
|
||||
@@ -311,14 +306,14 @@ extern "C" void Java_com_henrikrydgard_libnative_NativeRenderer_displayRender(JN
|
||||
glClearColor(1.0, 0.0, 1.0f, 1.0f);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
||||
}
|
||||
|
||||
|
||||
if (!frameCommand.empty()) {
|
||||
ILOG("frameCommand %s %s", frameCommand.c_str(), frameCommandParam.c_str());
|
||||
DLOG("frameCommand %s %s", frameCommand.c_str(), frameCommandParam.c_str());
|
||||
|
||||
jstring cmd = env->NewStringUTF(frameCommand.c_str());
|
||||
jstring param = env->NewStringUTF(frameCommandParam.c_str());
|
||||
env->CallVoidMethod(obj, postCommand, cmd, param);
|
||||
|
||||
|
||||
frameCommand = "";
|
||||
frameCommandParam = "";
|
||||
}
|
||||
@@ -326,9 +321,8 @@ extern "C" void Java_com_henrikrydgard_libnative_NativeRenderer_displayRender(JN
|
||||
|
||||
extern "C" void Java_com_henrikrydgard_libnative_NativeRenderer_displayShutdown(JNIEnv *env, jobject obj) {
|
||||
if (renderer_inited) {
|
||||
ILOG("Calling NativeDeviceLost();");
|
||||
NativeDeviceLost();
|
||||
ILOG("NativeDeviceLost completed.;");
|
||||
ILOG("NativeDeviceLost completed.");
|
||||
NativeShutdownGraphics();
|
||||
renderer_inited = false;
|
||||
NativeMessageReceived("recreateviews", "");
|
||||
@@ -441,8 +435,6 @@ extern "C" void Java_com_henrikrydgard_libnative_NativeApp_joystickAxis(
|
||||
break;
|
||||
}
|
||||
|
||||
// Hat is just stupid. Force translate it to dpad events. TODO
|
||||
|
||||
AxisInput axis;
|
||||
axis.axisId = axisId;
|
||||
axis.deviceId = deviceId;
|
||||
@@ -473,7 +465,7 @@ extern "C" void JNICALL Java_com_henrikrydgard_libnative_NativeApp_accelerometer
|
||||
AxisInput axis;
|
||||
axis.deviceId = DEVICE_ID_ACCELEROMETER;
|
||||
axis.flags = 0;
|
||||
|
||||
|
||||
axis.axisId = JOYSTICK_AXIS_ACCELEROMETER_X;
|
||||
axis.value = x;
|
||||
NativeAxis(axis);
|
||||
|
||||
@@ -218,7 +218,6 @@ public class NativeActivity extends Activity {
|
||||
String externalStorageDir = sdcard.getAbsolutePath();
|
||||
String dataDir = this.getFilesDir().getAbsolutePath();
|
||||
String apkFilePath = appInfo.sourceDir;
|
||||
NativeApp.sendMessage("Message from Java", "Hot Coffee");
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
||||
int dpi = metrics.densityDpi;
|
||||
@@ -230,7 +229,6 @@ public class NativeActivity extends Activity {
|
||||
String deviceType = Build.MANUFACTURER + ":" + Build.MODEL;
|
||||
String languageRegion = Locale.getDefault().getLanguage() + "_" + Locale.getDefault().getCountry();
|
||||
|
||||
// INIT!
|
||||
NativeApp.audioConfig(optimalFramesPerBuffer, optimalSampleRate);
|
||||
NativeApp.init(dpi, deviceType, languageRegion, apkFilePath, dataDir, externalStorageDir, libraryDir, installID, useOpenSL);
|
||||
Log.i(TAG, "Device: " + deviceType);
|
||||
|
||||
@@ -49,7 +49,6 @@ public class NativeGLView extends GLSurfaceView implements SensorEventListener,
|
||||
mSensorManager = (SensorManager)activity.getSystemService(Activity.SENSOR_SERVICE);
|
||||
mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
|
||||
|
||||
Log.i(TAG, "Initializing MOGA");
|
||||
mController = Controller.getInstance(activity);
|
||||
if (mController.init()) {
|
||||
Log.i(TAG, "MOGA initialized");
|
||||
|
||||
+6
-6
@@ -121,9 +121,9 @@ ZipAssetReader::ZipAssetReader(const char *zip_file, const char *in_zip_path) {
|
||||
GetFileListing("assets", &info, 0);
|
||||
for (int i = 0; i < info.size(); i++) {
|
||||
if (info[i].isDirectory) {
|
||||
ILOG("Directory: %s", info[i].name.c_str());
|
||||
DLOG("Directory: %s", info[i].name.c_str());
|
||||
} else {
|
||||
ILOG("File: %s", info[i].name.c_str());
|
||||
DLOG("File: %s", info[i].name.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -141,9 +141,9 @@ uint8_t *ZipAssetReader::ReadAsset(const char *path, size_t *size) {
|
||||
|
||||
bool ZipAssetReader::GetFileListing(const char *path, std::vector<FileInfo> *listing, const char *filter = 0)
|
||||
{
|
||||
ILOG("Zip path: %s", path);
|
||||
DLOG("Zip path: %s", path);
|
||||
std::set<std::string> filters;
|
||||
std::string tmp;
|
||||
std::string tmp;
|
||||
if (filter) {
|
||||
while (*filter) {
|
||||
if (*filter == ':') {
|
||||
@@ -212,7 +212,7 @@ bool ZipAssetReader::GetFileListing(const char *path, std::vector<FileInfo> *lis
|
||||
}
|
||||
listing->push_back(info);
|
||||
}
|
||||
|
||||
|
||||
std::sort(listing->begin(), listing->end());
|
||||
return true;
|
||||
}
|
||||
@@ -301,7 +301,7 @@ static int num_entries = 0;
|
||||
void VFSRegister(const char *prefix, AssetReader *reader) {
|
||||
entries[num_entries].prefix = prefix;
|
||||
entries[num_entries].reader = reader;
|
||||
ILOG("Registered VFS for prefix %s: %s", prefix, reader->toString().c_str());
|
||||
DLOG("Registered VFS for prefix %s: %s", prefix, reader->toString().c_str());
|
||||
num_entries++;
|
||||
}
|
||||
|
||||
|
||||
+15
-9
@@ -19,6 +19,11 @@ Texture::Texture() : id_(0) {
|
||||
register_gl_resource_holder(this);
|
||||
}
|
||||
|
||||
Texture::~Texture() {
|
||||
unregister_gl_resource_holder(this);
|
||||
Destroy();
|
||||
}
|
||||
|
||||
void Texture::Destroy() {
|
||||
if (id_) {
|
||||
glDeleteTextures(1, &id_);
|
||||
@@ -27,14 +32,13 @@ void Texture::Destroy() {
|
||||
}
|
||||
|
||||
void Texture::GLLost() {
|
||||
ILOG("Reloading lost texture %s", filename_.c_str());
|
||||
Load(filename_.c_str());
|
||||
ILOG("Reloaded lost texture %s", filename_.c_str());
|
||||
}
|
||||
|
||||
Texture::~Texture() {
|
||||
unregister_gl_resource_holder(this);
|
||||
Destroy();
|
||||
if (!filename_.empty()) {
|
||||
Load(filename_.c_str());
|
||||
ILOG("Reloaded lost texture %s", filename_.c_str());
|
||||
} else {
|
||||
WLOG("Texture cannot be restored - has no filename");
|
||||
Destroy();
|
||||
}
|
||||
}
|
||||
|
||||
static void SetTextureParameters(int zim_flags) {
|
||||
@@ -133,8 +137,10 @@ bool Texture::Load(const char *filename) {
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
} else if (!name || !strlen(name)) {
|
||||
ELOG("Failed to identify image file %s by extension", name);
|
||||
} else {
|
||||
ELOG("Cannot load a texture with an empty filename");
|
||||
}
|
||||
LoadXOR();
|
||||
return false;
|
||||
|
||||
@@ -124,13 +124,11 @@ void CheckGLExtensions() {
|
||||
gl_extensions.gpuVendor = GPU_VENDOR_UNKNOWN;
|
||||
}
|
||||
|
||||
ILOG("GPU Vendor : %s", cvendor);
|
||||
ILOG("GPU Vendor : %s ; GL version str: %s", cvendor, versionStr ? versionStr : "N/A");
|
||||
|
||||
#ifndef USING_GLES2
|
||||
|
||||
char buffer[64] = {0};
|
||||
if (versionStr) {
|
||||
ILOG("GL version str: %s", versionStr);
|
||||
strncpy(buffer, versionStr, 63);
|
||||
}
|
||||
const char *lastNumStart = buffer;
|
||||
@@ -212,9 +210,12 @@ void CheckGLExtensions() {
|
||||
#if defined(ANDROID) || defined(BLACKBERRY)
|
||||
// On Android, incredibly, this is not consistently non-zero! It does seem to have the same value though.
|
||||
// https://twitter.com/ID_AA_Carmack/status/387383037794603008
|
||||
#ifdef _DEBUG
|
||||
void *invalidAddress = (void *)eglGetProcAddress("InvalidGlCall1");
|
||||
void *invalidAddress2 = (void *)eglGetProcAddress("AnotherInvalidGlCall2");
|
||||
ILOG("Addresses returned for invalid extensions: %p %p", invalidAddress, invalidAddress2);
|
||||
DLOG("Addresses returned for invalid extensions: %p %p", invalidAddress, invalidAddress2);
|
||||
#endif
|
||||
|
||||
if (gl_extensions.NV_draw_texture) {
|
||||
glDrawTextureNV = (PFNGLDRAWTEXTURENVPROC)eglGetProcAddress("glDrawTextureNV");
|
||||
}
|
||||
@@ -271,7 +272,6 @@ void CheckGLExtensions() {
|
||||
} else {
|
||||
g_all_egl_extensions = "";
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef USING_GLES2
|
||||
|
||||
Reference in new issue
Block a user