mirror of
https://gitlab.com/shinovon/re3-symbian.git
synced 2026-05-23 01:57:21 +03:00
A log was added that creates a re3_log.txt file on the memory card for debugging purposes
This commit is contained in:
parent
33a8324d08
commit
905ab38a64
5 changed files with 45 additions and 0 deletions
|
|
@ -97,6 +97,7 @@ SOURCEPATH ../src/skel
|
||||||
SOURCE skeleton.cpp
|
SOURCE skeleton.cpp
|
||||||
SOURCEPATH ../src/skel/symbian
|
SOURCEPATH ../src/skel/symbian
|
||||||
SOURCE symbian.cpp
|
SOURCE symbian.cpp
|
||||||
|
SOURCE log.cpp
|
||||||
SOURCEPATH ../src/text
|
SOURCEPATH ../src/text
|
||||||
SOURCE Messages.cpp Pager.cpp Text.cpp
|
SOURCE Messages.cpp Pager.cpp Text.cpp
|
||||||
SOURCEPATH ../src/vehicles
|
SOURCEPATH ../src/vehicles
|
||||||
|
|
|
||||||
BIN
sis/re3.sisx
BIN
sis/re3.sisx
Binary file not shown.
34
src/skel/symbian/log.cpp
Normal file
34
src/skel/symbian/log.cpp
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include "log.h"
|
||||||
|
|
||||||
|
void InitLog()
|
||||||
|
{
|
||||||
|
FILE* f = fopen("E:\\re3_log.txt", "w");
|
||||||
|
if(f) fclose(f);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Log(const char* txt)
|
||||||
|
{
|
||||||
|
FILE* f = fopen("E:\\re3_log.txt", "a");
|
||||||
|
if(f){
|
||||||
|
fprintf(f, "%s\n", txt);
|
||||||
|
fclose(f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Logf(const char* fmt, ...)
|
||||||
|
{
|
||||||
|
FILE* f = fopen("E:\\re3_log.txt", "a");
|
||||||
|
if(!f) return;
|
||||||
|
|
||||||
|
char buf[256];
|
||||||
|
|
||||||
|
va_list args;
|
||||||
|
va_start(args, fmt);
|
||||||
|
vsnprintf(buf, sizeof(buf), fmt, args);
|
||||||
|
va_end(args);
|
||||||
|
|
||||||
|
fprintf(f, "%s\n", buf);
|
||||||
|
fclose(f);
|
||||||
|
}
|
||||||
5
src/skel/symbian/log.h
Normal file
5
src/skel/symbian/log.h
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
void InitLog();
|
||||||
|
void Log(const char* txt);
|
||||||
|
void Logf(const char* fmt, ...);
|
||||||
|
|
@ -38,6 +38,8 @@
|
||||||
#include "Text.h"
|
#include "Text.h"
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
|
|
||||||
|
#include "log.h"
|
||||||
|
|
||||||
psGlobalType psGlobal;
|
psGlobalType psGlobal;
|
||||||
|
|
||||||
uint32 gGameState = 0;
|
uint32 gGameState = 0;
|
||||||
|
|
@ -335,6 +337,9 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConstructL(const TRect& aRect, CAknAppUi* aAppUi) {
|
void ConstructL(const TRect& aRect, CAknAppUi* aAppUi) {
|
||||||
|
InitLog();
|
||||||
|
Log("App start");
|
||||||
|
|
||||||
iAppUi = aAppUi;
|
iAppUi = aAppUi;
|
||||||
CreateWindowL();
|
CreateWindowL();
|
||||||
iAppUi->SetOrientationL(CAknAppUiBase::EAppUiOrientationLandscape);
|
iAppUi->SetOrientationL(CAknAppUiBase::EAppUiOrientationLandscape);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue