early-access version 1436

This commit is contained in:
pineappleEA 2021-02-10 01:19:46 +01:00
parent 67b82c5caa
commit ccf46180a7
5 changed files with 34 additions and 44 deletions

View file

@ -1,7 +1,7 @@
yuzu emulator early access
=============
This is the source code for early-access 1433.
This is the source code for early-access 1436.
## Legal Notice

View file

@ -60,9 +60,6 @@ constexpr size_t TOTAL_CONST_BUFFER_BYTES =
constexpr size_t NUM_SUPPORTED_VERTEX_ATTRIBUTES = 16;
constexpr size_t NUM_SUPPORTED_VERTEX_BINDINGS = 16;
constexpr size_t MAX_TEXTURES = 192;
constexpr size_t MAX_IMAGES = 48;
struct TextureHandle {
constexpr TextureHandle(u32 data, bool via_header_index) {
const Tegra::Texture::TextureHandle handle{data};

View file

@ -169,40 +169,6 @@ template <u32 GOB_EXTENT>
return Common::DivCeil(AdjustMipSize(size, level), block_size);
}
[[nodiscard]] constexpr u32 LayerSize(const TICEntry& config, PixelFormat format) {
return config.Width() * config.Height() * BytesPerBlock(format);
}
[[nodiscard]] constexpr bool HasTwoDimsPerLayer(TextureType type) {
switch (type) {
case TextureType::Texture2D:
case TextureType::Texture2DArray:
case TextureType::Texture2DNoMipmap:
case TextureType::Texture3D:
case TextureType::TextureCubeArray:
case TextureType::TextureCubemap:
return true;
case TextureType::Texture1D:
case TextureType::Texture1DArray:
case TextureType::Texture1DBuffer:
return false;
}
return false;
}
[[nodiscard]] constexpr bool HasTwoDimsPerLayer(ImageType type) {
switch (type) {
case ImageType::e2D:
case ImageType::e3D:
case ImageType::Linear:
return true;
case ImageType::e1D:
case ImageType::Buffer:
return false;
}
UNREACHABLE_MSG("Invalid image type={}", static_cast<int>(type));
}
[[nodiscard]] constexpr std::pair<int, int> Samples(int num_samples) {
switch (num_samples) {
case 1:

View file

@ -226,6 +226,9 @@ void PlayerControlPreview::paintEvent(QPaintEvent* event) {
case Settings::ControllerType::RightJoycon:
DrawRightController(p, center);
break;
case Settings::ControllerType::GameCube:
DrawGCController(p, center);
break;
case Settings::ControllerType::ProController:
default:
DrawProController(p, center);
@ -699,9 +702,9 @@ void PlayerControlPreview::DrawProController(QPainter& p, const QPointF center)
{
// Draw joysticks
using namespace Settings::NativeAnalog;
DrawProJoystick(p, center + QPointF(-111, -55) + (axis_values[LStick].value * 11),
DrawProJoystick(p, center + QPointF(-111, -55), axis_values[LStick].value, 11,
button_values[Settings::NativeButton::LStick]);
DrawProJoystick(p, center + QPointF(51, 0) + (axis_values[RStick].value * 11),
DrawProJoystick(p, center + QPointF(51, 0), axis_values[RStick].value, 11,
button_values[Settings::NativeButton::RStick]);
DrawRawJoystick(p, center + QPointF(-50, 105), axis_values[LStick].raw_value,
axis_values[LStick].properties);
@ -2273,15 +2276,39 @@ void PlayerControlPreview::DrawJoystickSideview(QPainter& p, const QPointF cente
p.drawLine(p2.at(32), p2.at(71));
}
void PlayerControlPreview::DrawProJoystick(QPainter& p, const QPointF center, bool pressed) {
void PlayerControlPreview::DrawProJoystick(QPainter& p, const QPointF center, const QPointF offset,
float offset_scalar, bool pressed) {
const float radius1 = 24.0f;
const float radius2 = 17.0f;
const QPointF offset_center = center + offset * offset_scalar;
const auto amplitude = static_cast<float>(
1.0 - std::sqrt((offset.x() * offset.x()) + (offset.y() * offset.y())) * 0.1f);
const float rotation =
((offset.x() == 0) ? atan(1) * 2 : atan(offset.y() / offset.x())) * (180 / (atan(1) * 4));
p.save();
p.translate(offset_center);
p.rotate(rotation);
// Outer circle
p.setPen(colors.outline);
p.setBrush(pressed ? colors.highlight : colors.button);
DrawCircle(p, center, 24.0f);
p.drawEllipse(QPointF(0, 0), radius1 * amplitude, radius1);
// Inner circle
p.setBrush(pressed ? colors.highlight2 : colors.button2);
DrawCircle(p, center, 17.0f);
const float inner_offset =
(radius1 - radius2) * 0.4f * ((offset.x() == 0 && offset.y() < 0) ? -1.0f : 1.0f);
const float offset_factor = (1.0f - amplitude) / 0.1f;
p.drawEllipse(QPointF((offset.x() < 0) ? -inner_offset : inner_offset, 0) * offset_factor,
radius2 * amplitude, radius2);
p.restore();
}
void PlayerControlPreview::DrawGCJoystick(QPainter& p, const QPointF center, bool pressed) {

View file

@ -140,7 +140,7 @@ private:
void DrawJoystickSideview(QPainter& p, QPointF center, float angle, float size, bool pressed);
void DrawRawJoystick(QPainter& p, QPointF center, const QPointF value,
const Input::AnalogProperties properties);
void DrawProJoystick(QPainter& p, QPointF center, bool pressed);
void DrawProJoystick(QPainter& p, QPointF center, QPointF offset, float scalar, bool pressed);
void DrawGCJoystick(QPainter& p, QPointF center, bool pressed);
// Draw button functions