Skip to content

Commit

Permalink
add DebugFileInterface
Browse files Browse the repository at this point in the history
add android mappingFileUploadEnabled true for release
update android firebase-crashlytics 18.4.1
fix TextField updateTextLinesDimension
fix build Tools
  • Loading branch information
irov committed Sep 6, 2023
1 parent 4c38a67 commit a05e6e5
Show file tree
Hide file tree
Showing 43 changed files with 252 additions and 215 deletions.
16 changes: 11 additions & 5 deletions gradle/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,20 @@ android {
}

buildTypes {
if (project.hasProperty("ANDROID_APP_DEBUG_STORE_FILE") == true) {
debug {
debug {
if (project.hasProperty("ANDROID_APP_DEBUG_STORE_FILE") == true) {
signingConfig signingConfigs.debug
}
}

if (project.hasProperty("ANDROID_APP_RELEASE_STORE_FILE") == true) {
release {
release {
if (MENGINE_APP_PLUGIN_FIREBASE_CRASHLYTICS == true) {
firebaseCrashlytics {
mappingFileUploadEnabled true
}
}

if (project.hasProperty("ANDROID_APP_RELEASE_STORE_FILE") == true) {
signingConfig signingConfigs.release
}
}
Expand Down Expand Up @@ -310,7 +316,7 @@ android {
}

androidResources {
noCompress 'pak', 'bin'
noCompress += ['pak', 'bin']
}

namespace "org.Mengine.Project"
Expand Down
2 changes: 1 addition & 1 deletion gradle/minify.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ android {
buildTypes {
if (ANDROID_APP_DEBUG_MINIFY_ENABLE) {
debug {
minifyEnabled true
minifyEnabled false

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
Expand Down
4 changes: 2 additions & 2 deletions gradle/plugins/FirebaseCrashlytics/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
}

dependencies {
implementation 'com.google.firebase:firebase-crashlytics:18.4.0'
implementation 'com.google.firebase:firebase-crashlytics-ndk:18.4.0'
implementation 'com.google.firebase:firebase-crashlytics:18.4.1'
implementation 'com.google.firebase:firebase-crashlytics-ndk:18.4.1'
}

apply from: rootProject.projectDir.getAbsolutePath() + '/plugins/plugin_extensions.gradle'
42 changes: 15 additions & 27 deletions src/Engine/TextField.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ namespace Mengine
}
}
//////////////////////////////////////////////////////////////////////////
bool TextField::updateTextLinesDimension_( const FontInterfacePtr & _font, const VectorTextLineChunks2 & _textLines, mt::vec2f * const _textSize, mt::vec2f * const _textOffset, uint32_t * const _charCount, uint32_t * const _layoutCount ) const
bool TextField::updateTextLinesDimension_( const FontInterfacePtr & _font, const VectorTextLineChunks2 & _textLines ) const
{
float charOffset = this->calcCharOffset();
float lineOffset = this->calcLineOffset();
Expand Down Expand Up @@ -1036,14 +1036,16 @@ namespace Mengine

if( layouts.empty() == true )
{
*_charCount = 0;
*_layoutCount = 0;
*_textSize = mt::vec2f( 0.f, 0.f );
*_textOffset = mt::vec2f( 0.f, 0.f );
m_charCount = 0;
m_layoutCount = 0;
m_textSize = mt::vec2f( 0.f, 0.f );
m_textOffset = mt::vec2f( 0.f, 0.f );

return true;
}

m_layoutCount = (uint32_t)layouts.size();

uint32_t charCount = 0;

float text_length = 0.f;
Expand All @@ -1069,37 +1071,32 @@ namespace Mengine
charCount += line_chars;
}

*_charCount = charCount;

*_layoutCount = (uint32_t)layouts.size();
m_charCount = charCount;

mt::vec2f textSize;
textSize.x = text_length;

float fontHeight = _font->getFontHeight();
//float fontAscent = _font->getFontAscent();

VectorTextLinesLayout::size_type lineCount = layouts.size();

if( lineCount > 0 )
if( m_layoutCount > 0 )
{
textSize.y = (lineOffset + fontHeight) * (lineCount - 1) + fontHeight + m_extraThickness * 2.f;
textSize.y = (lineOffset + fontHeight) * (m_layoutCount - 1) + fontHeight + m_extraThickness * 2.f;
}
else
{
textSize.y = fontHeight + m_extraThickness * 2.f;
}

*_textSize = textSize;

mt::vec2f textOffset;
textOffset.x = text_offset;
m_textSize = textSize;

float lines_offset = this->calcLinesOffset( lineOffset, _font );

mt::vec2f textOffset;
textOffset.x = text_offset;
textOffset.y = -lines_offset;

*_textOffset = textOffset;
m_textOffset = textOffset;

return true;
}
Expand Down Expand Up @@ -1193,20 +1190,11 @@ namespace Mengine

this->updateTextLinesWrap_( &m_cacheTextLines );

mt::vec2f textSize;
mt::vec2f textOffset;
uint32_t charCount;
uint32_t layoutCount;
if( this->updateTextLinesDimension_( baseFont, m_cacheTextLines, &textSize, &textOffset, &charCount, &layoutCount ) == false )
if( this->updateTextLinesDimension_( baseFont, m_cacheTextLines ) == false )
{
return false;
}

m_textSize = textSize;
m_textOffset = textOffset;
m_charCount = charCount;
m_layoutCount = layoutCount;

m_autoScaleFactor = 1.f;

if( m_autoScale == true )
Expand Down
2 changes: 1 addition & 1 deletion src/Engine/TextField.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ namespace Mengine
bool updateTextLines_() const;
void updateTextLinesWrap_( VectorTextLineChunks2 * const _textLines ) const;
void updateTextLinesMaxCount_( VectorTextLineChunks2 * const _textLines ) const;
bool updateTextLinesDimension_( const FontInterfacePtr & _font, const VectorTextLineChunks2 & _textLines, mt::vec2f * const _textSize, mt::vec2f * const _textOffset, uint32_t * const _charCount, uint32_t * const _layoutCount ) const;
bool updateTextLinesDimension_( const FontInterfacePtr & _font, const VectorTextLineChunks2 & _textLines ) const;

public:
MENGINE_INLINE const TextEntryInterfacePtr & getTotalTextEntry() const;
Expand Down
1 change: 1 addition & 0 deletions src/Interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ Common
PersistentSystemInterface.h
DateTimeSystemInterface.h
HttpSystemInterface.h
DebugFileInterface.h
)

ADD_FILTER(
Expand Down
22 changes: 22 additions & 0 deletions src/Interface/DebugFileInterface.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#pragma once

#include "Kernel/Mixin.h"
#include "Kernel/FilePath.h"

namespace Mengine
{
//////////////////////////////////////////////////////////////////////////
class DebugFileInterface
: public Mixin
{
public:
virtual const FilePath & getDebugRelationPath() const = 0;
virtual const FilePath & getDebugFolderPath() const = 0;
virtual const FilePath & getDebugFilePath() const = 0;
};
//////////////////////////////////////////////////////////////////////////
typedef IntrusivePtr<DebugFileInterface> DebugFileInterfacePtr;
//////////////////////////////////////////////////////////////////////////
}


7 changes: 0 additions & 7 deletions src/Interface/FileInputStreamInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ namespace Mengine
public:
virtual bool open( const FilePath & _relationPath, const FilePath & _folderPath, const FilePath & _filePath, size_t _offset, size_t _size, bool _streaming, bool _share ) = 0;
virtual bool close() = 0;

#if defined(MENGINE_DEBUG)
public:
virtual const FilePath & getRelationPath() const = 0;
virtual const FilePath & getFolderPath() const = 0;
virtual const FilePath & getFilePath() const = 0;
#endif
};
//////////////////////////////////////////////////////////////////////////
typedef IntrusivePtr<FileInputStreamInterface, InputStreamInterface> FileInputStreamInterfacePtr;
Expand Down
7 changes: 0 additions & 7 deletions src/Interface/FileOutputStreamInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ namespace Mengine
public:
virtual bool open( const FilePath & _relationPath, const FilePath & _folderPath, const FilePath & _filePath, bool _withTemp ) = 0;
virtual bool close() = 0;

#if defined(MENGINE_DEBUG)
public:
virtual const FilePath & getRelationPath() const = 0;
virtual const FilePath & getFolderPath() const = 0;
virtual const FilePath & getFilePath() const = 0;
#endif
};
//////////////////////////////////////////////////////////////////////////
typedef IntrusivePtr<FileOutputStreamInterface, OutputStreamInterface> FileOutputStreamInterfacePtr;
Expand Down
2 changes: 1 addition & 1 deletion src/Kernel/BaseRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ namespace Mengine
RenderContext context;
this->mergeRenderContext( _context, &context );

if( m_localHide == false && this->isPersonalTransparent() == false )
if( this->isLocalHide() == false && this->isPersonalTransparent() == false )
{
this->render( _renderPipeline, &context );
}
Expand Down
27 changes: 13 additions & 14 deletions src/Kernel/FileStreamHelper.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#include "FileStreamHelper.h"

#if defined(MENGINE_DEBUG)
# include "Interface/FileInputStreamInterface.h"
# include "Interface/FileOutputStreamInterface.h"
# include "Interface/DebugFileInterface.h"
#endif

#include "Kernel/AssertionMemoryPanic.h"
Expand Down Expand Up @@ -147,14 +146,14 @@ namespace Mengine
MENGINE_UNUSED( _stream );

#if defined(MENGINE_DEBUG)
FileInputStreamInterface * stream = stdex::intrusive_dynamic_get<FileInputStreamInterface *>( _stream );
DebugFileInterface * stream = stdex::intrusive_dynamic_get<DebugFileInterface *>( _stream );

if( stream == nullptr )
{
return FilePath::none();
}

const FilePath & relationPath = stream->getRelationPath();
const FilePath & relationPath = stream->getDebugRelationPath();

return relationPath;
#else
Expand All @@ -167,14 +166,14 @@ namespace Mengine
MENGINE_UNUSED( _stream );

#if defined(MENGINE_DEBUG)
FileInputStreamInterface * stream = stdex::intrusive_dynamic_get<FileInputStreamInterface *>( _stream );
DebugFileInterface * stream = stdex::intrusive_dynamic_get<DebugFileInterface *>( _stream );

if( stream == nullptr )
{
return FilePath::none();
}

const FilePath & folderPath = stream->getFolderPath();
const FilePath & folderPath = stream->getDebugFolderPath();

return folderPath;
#else
Expand All @@ -187,14 +186,14 @@ namespace Mengine
MENGINE_UNUSED( _stream );

#if defined(MENGINE_DEBUG)
FileInputStreamInterface * stream = stdex::intrusive_dynamic_get<FileInputStreamInterface *>( _stream );
DebugFileInterface * stream = stdex::intrusive_dynamic_get<DebugFileInterface *>( _stream );

if( stream == nullptr )
{
return FilePath::none();
}

const FilePath & filePath = stream->getFilePath();
const FilePath & filePath = stream->getDebugFilePath();

return filePath;
#else
Expand All @@ -207,14 +206,14 @@ namespace Mengine
MENGINE_UNUSED( _stream );

#if defined(MENGINE_DEBUG)
FileOutputStreamInterface * stream = stdex::intrusive_dynamic_get<FileOutputStreamInterface *>( _stream );
DebugFileInterface * stream = stdex::intrusive_dynamic_get<DebugFileInterface *>( _stream );

if( stream == nullptr )
{
return FilePath::none();
}

const FilePath & relationPath = stream->getRelationPath();
const FilePath & relationPath = stream->getDebugRelationPath();

return relationPath;
#else
Expand All @@ -227,14 +226,14 @@ namespace Mengine
MENGINE_UNUSED( _stream );

#if defined(MENGINE_DEBUG)
FileOutputStreamInterface * stream = stdex::intrusive_dynamic_get<FileOutputStreamInterface *>( _stream );
DebugFileInterface * stream = stdex::intrusive_dynamic_get<DebugFileInterface *>( _stream );

if( stream == nullptr )
{
return FilePath::none();
}

const FilePath & folderPath = stream->getFolderPath();
const FilePath & folderPath = stream->getDebugFolderPath();

return folderPath;
#else
Expand All @@ -247,14 +246,14 @@ namespace Mengine
MENGINE_UNUSED( _stream );

#if defined(MENGINE_DEBUG)
FileOutputStreamInterface * stream = stdex::intrusive_dynamic_get<FileOutputStreamInterface *>( _stream );
DebugFileInterface * stream = stdex::intrusive_dynamic_get<DebugFileInterface *>( _stream );

if( stream == nullptr )
{
return FilePath::none();
}

const FilePath & filePath = stream->getFilePath();
const FilePath & filePath = stream->getDebugFilePath();

return filePath;

Expand Down
27 changes: 13 additions & 14 deletions src/Platforms/SDLPlatform/SDLPlatformService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1149,15 +1149,18 @@ namespace Mengine
APPLICATION_SERVICE()
->endUpdate();

if( updating == false )
MENGINE_UNUSED( _pause );

#if defined(MENGINE_PLATFORM_WINDOWS) || defined(MENGINE_PLATFORM_MACOS)
if( _pause == true )
{
if( m_pauseUpdatingTime < 0.f )
if( updating == false )
{
m_pauseUpdatingTime = _frameTime;
}
if( m_pauseUpdatingTime < 0.f )
{
m_pauseUpdatingTime = _frameTime;
}

if( _pause == true )
{
if( m_sleepMode == true )
{
SDL_Delay( 100 );
Expand All @@ -1167,22 +1170,18 @@ namespace Mengine
SDL_Delay( 1 );
}
}
}
else
{
#if defined(MENGINE_PLATFORM_WINDOWS) || defined(MENGINE_PLATFORM_MACOS)
if( _pause == true )
else
{
bool OPTION_maxfps = HAS_OPTION( "maxfps" );

if( APPLICATION_SERVICE()
->getVSync() == false && OPTION_maxfps == false )
->getVSync() == false && OPTION_maxfps == false )
{
SDL_Delay( 1 );
}
}
#endif
}
#endif

return true;
}
Expand Down
Loading

0 comments on commit a05e6e5

Please sign in to comment.