cleanup, don't compress rcc file to fix corruption

This commit is contained in:
SamGondelman 2018-03-12 13:05:03 -07:00
parent 3f762c7900
commit 4bef033d6f
15 changed files with 86 additions and 91 deletions

Binary file not shown.

Binary file not shown.

View file

@ -53,7 +53,7 @@ Enter the repository `android` directory
Execute a gradle pre-build setup. This step should only need to be done once
`gradle setupDepedencies`
`gradle setupDependencies`
# Building & Running

View file

@ -23,12 +23,22 @@ set(RESOURCES_QRC ${CMAKE_CURRENT_BINARY_DIR}/resources.qrc)
set(RESOURCES_RCC ${CMAKE_CURRENT_SOURCE_DIR}/compiledResources/resources.rcc)
generate_qrc(OUTPUT ${RESOURCES_QRC} PATH ${CMAKE_CURRENT_SOURCE_DIR}/resources CUSTOM_PATHS ${CUSTOM_INTERFACE_QRC_PATHS} GLOBS *)
if (ANDROID)
# on Android, don't compress the rcc binary
add_custom_command(
OUTPUT ${RESOURCES_RCC}
DEPENDS ${RESOURCES_QRC} ${GENERATE_QRC_DEPENDS}
COMMAND "${QT_DIR}/bin/rcc"
ARGS ${RESOURCES_QRC} -no-compress -binary -o ${RESOURCES_RCC}
)
else ()
add_custom_command(
OUTPUT ${RESOURCES_RCC}
DEPENDS ${RESOURCES_QRC} ${GENERATE_QRC_DEPENDS}
COMMAND "${QT_DIR}/bin/rcc"
ARGS ${RESOURCES_QRC} -binary -o ${RESOURCES_RCC}
)
endif()
list(APPEND GENERATE_QRC_DEPENDS ${RESOURCES_RCC})
add_custom_target(resources ALL DEPENDS ${GENERATE_QRC_DEPENDS})

View file

@ -156,9 +156,6 @@ Item {
height: android.dimen.atLeast1440p ? 120 : 90
inputMethodHints: Qt.ImhNoPredictiveText
//helperText: "Hint is here"
anchors {
//verticalCenter: addressBackground.verticalCenter
}
font.pixelSize: hifi.fonts.pixelSize * 3.75
onTextChanged: {
//filterChoicesByText();

View file

@ -1998,20 +1998,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
connect(_window, SIGNAL(windowMinimizedChanged(bool)), this, SLOT(windowMinimizedChanged(bool)));
qCDebug(interfaceapp, "Startup time: %4.2f seconds.", (double)startupTimer.elapsed() / 1000.0);
{
PROFILE_RANGE(render, "Process Default Skybox");
auto textureCache = DependencyManager::get<TextureCache>();
QFileSelector fileSelector;
fileSelector.setExtraSelectors(FileUtils::getFileSelectors());
auto skyboxUrl = fileSelector.select(PathUtils::resourcesPath() + "images/Default-Sky-9-cubemap.ktx");
_defaultSkyboxTexture = gpu::Texture::unserialize(skyboxUrl.toStdString());
_defaultSkyboxAmbientTexture = _defaultSkyboxTexture;
_defaultSkybox->setCubemap(_defaultSkyboxTexture);
}
EntityTreeRenderer::setEntitiesShouldFadeFunction([this]() {
SharedNodePointer entityServerNode = DependencyManager::get<NodeList>()->soloNodeOfType(NodeType::EntityServer);
return entityServerNode && !isPhysicsEnabled();
@ -2461,7 +2447,6 @@ void Application::initializeGL() {
DeadlockWatchdogThread::withPause([&] {
// Set up the render engine
render::CullFunctor cullFunctor = LODManager::shouldRender;
static const QString RENDER_FORWARD = "HIFI_RENDER_FORWARD";
_renderEngine->addJob<UpdateSceneTask>("UpdateScene");
#ifndef Q_OS_ANDROID
_renderEngine->addJob<SecondaryCameraRenderTask>("SecondaryCameraJob", cullFunctor, !DISABLE_DEFERRED);

View file

@ -272,10 +272,6 @@ public:
void shareSnapshot(const QString& filename, const QUrl& href = QUrl(""));
graphics::SkyboxPointer getDefaultSkybox() const { return _defaultSkybox; }
gpu::TexturePointer getDefaultSkyboxTexture() const { return _defaultSkyboxTexture; }
gpu::TexturePointer getDefaultSkyboxAmbientTexture() const { return _defaultSkyboxAmbientTexture; }
OverlayID getTabletScreenID() const;
OverlayID getTabletHomeButtonID() const;
QUuid getTabletFrameID() const; // may be an entity or an overlay
@ -678,10 +674,6 @@ private:
ConnectionMonitor _connectionMonitor;
graphics::SkyboxPointer _defaultSkybox { new ProceduralSkybox() } ;
gpu::TexturePointer _defaultSkyboxTexture;
gpu::TexturePointer _defaultSkyboxAmbientTexture;
QTimer _addAssetToWorldResizeTimer;
QHash<QUuid, int> _addAssetToWorldResizeList;

View file

@ -28,7 +28,7 @@ void Basic2DWindowOpenGLDisplayPlugin::customizeContext() {
auto iconPath = PathUtils::resourcesPath() + "images/analog_stick.png";
auto image = QImage(iconPath);
qreal dpi = getFullscreenTarget()->physicalDotsPerInch();
_virtualPadPixelSize = dpi * 512 / 534; // 534 dpi for Pixel XL and Mate 9 Pro
_virtualPadPixelSize = dpi * VirtualPad::Manager::PIXEL_SIZE / VirtualPad::Manager::DPI;
if (image.format() != QImage::Format_ARGB32) {
image = image.convertToFormat(QImage::Format_ARGB32);

View file

@ -90,7 +90,7 @@ public:
glm::vec2 getReticleMaximumPosition() const;
glm::mat4 getReticleTransform(const glm::mat4& eyePose = glm::mat4(), const glm::vec3& headPosition = glm::vec3()) const;
glm::mat4 getPoint2DTransform(const glm::vec2& point = glm::vec2(), float sizeX = 512.0f, float sizeY = 512.0f) const;
glm::mat4 getPoint2DTransform(const glm::vec2& point, float sizeX , float sizeY) const;
ReticleInterface* getReticleInterface() { return _reticleInterface; }

View file

@ -50,8 +50,8 @@ void TouchscreenVirtualPadDevice::init() {
_screenDPIProvided = eventScreen->physicalDotsPerInch();
_screenDPI = eventScreen->physicalDotsPerInch();
_fixedRadius = _screenDPI * 256 / 534;
_fixedRadiusForCalc = _fixedRadius - _screenDPI * 105 / 534; // 105 is the radius of the stick circle
_fixedRadius = _screenDPI * 0.5f * VirtualPad::Manager::PIXEL_SIZE / VirtualPad::Manager::DPI;
_fixedRadiusForCalc = _fixedRadius - _screenDPI * VirtualPad::Manager::STICK_RADIUS / VirtualPad::Manager::DPI;
}
auto& virtualPadManager = VirtualPad::Manager::instance();
@ -69,7 +69,7 @@ void TouchscreenVirtualPadDevice::setupFixedCenter(VirtualPad::Manager& virtualP
if (_extraBottomMargin == virtualPadManager.extraBottomMargin() && !force) return; // Our only criteria to decide a center change is the bottom margin
_extraBottomMargin = virtualPadManager.extraBottomMargin();
float margin = _screenDPI * 59 / 534; // 59px is for our 'base' of 534dpi (Pixel XL or Huawei Mate 9 Pro)
float margin = _screenDPI * VirtualPad::Manager::BASE_MARGIN / VirtualPad::Manager::DPI;
QScreen* eventScreen = qApp->primaryScreen(); // do not call every time
_fixedCenterPosition = glm::vec2( _fixedRadius + margin, eventScreen->size().height() - margin - _fixedRadius - _extraBottomMargin);
@ -103,14 +103,14 @@ glm::vec2 TouchscreenVirtualPadDevice::clippedPointInCircle(float radius, glm::v
float b = touchPoint.y - m * touchPoint.x;
// quadtratic coefs of circumference and line intersection
float qa = pow(m,2)+1;
float qb = 2 * ( m * b - origin.x - origin.y * m );
float qc = powf(origin.x, 2) - powf(radius,2) + b * b - 2 * b * origin.y + powf(origin.y, 2);
float qa = powf(m, 2.0f) + 1.0f;
float qb = 2.0f * ( m * b - origin.x - origin.y * m);
float qc = powf(origin.x, 2.0f) - powf(radius, 2.0f) + b * b - 2.0f * b * origin.y + powf(origin.y, 2.0f);
float discr = qb * qb - 4 * qa * qc;
float discrSign = deltaX>0?1.0:-1.0;
float discr = qb * qb - 4.0f * qa * qc;
float discrSign = deltaX > 0.0f ? 1.0f : - 1.0f;
float finalX = (- qb + discrSign * sqrtf(discr)) / (2 * qa);
float finalX = (-qb + discrSign * sqrtf(discr)) / (2.0f * qa);
float finalY = m * finalX + b;
return vec2(finalX, finalY);

View file

@ -34,6 +34,11 @@ namespace VirtualPad {
return _currentTouch;
}
const float Manager::DPI = 534.0f;
const float Manager::PIXEL_SIZE = 512.0f;
const float Manager::STICK_RADIUS = 105.0f;
const float Manager::BASE_MARGIN = 59.0f;
Manager::Manager() {
}

View file

@ -44,6 +44,12 @@ namespace VirtualPad {
void hide(bool hide);
int extraBottomMargin();
void setExtraBottomMargin(int margin);
static const float DPI;
static const float PIXEL_SIZE;
static const float STICK_RADIUS;
static const float BASE_MARGIN;
private:
Instance _leftVPadInstance;
bool _enabled;