mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-01-18 03:43:11 +00:00
Merge pull request #19851 from hrydgard/notice-layout-fix
Some checks are pending
Build / build-windows (ARM64) (push) Waiting to run
Build / build-windows (x64) (push) Waiting to run
Build / build-uwp (push) Waiting to run
Build / test-windows (push) Blocked by required conditions
Build / build (./b.sh --headless --unittest --fat --no-png --no-sdl2, clang, clang++, test, macos, macos-latest) (push) Waiting to run
Build / build (./b.sh --headless --unittest, clang, clang++, test, clang-normal, ubuntu-latest) (push) Waiting to run
Build / build (./b.sh --headless --unittest, gcc, g++, gcc-normal, ubuntu-latest) (push) Waiting to run
Build / build (./b.sh --ios, clang, clang++, ios, ios, macos-latest) (push) Waiting to run
Build / build (./b.sh --libretro_android ppsspp_libretro, clang, clang++, android, android-libretro, ubuntu-latest) (push) Waiting to run
Build / build (./b.sh --qt, gcc, g++, qt, qt, ubuntu-latest) (push) Waiting to run
Build / build (cd android && ./ab.sh -j2 APP_ABI=arm64-v8a OPENXR=1, clang, clang++, android, android-vr, ubuntu-latest) (push) Waiting to run
Build / build (cd android && ./ab.sh -j2 APP_ABI=arm64-v8a UNITTEST=1 HEADLESS=1, clang, clang++, android, android-arm64, ubuntu-latest) (push) Waiting to run
Build / build (cd android && ./ab.sh -j2 APP_ABI=armeabi-v7a UNITTEST=1 HEADLESS=1, clang, clang++, android, android-arm32, ubuntu-latest) (push) Waiting to run
Build / build (cd android && ./ab.sh -j2 APP_ABI=x86_64 UNITTEST=1 HEADLESS=1, clang, clang++, android, android-x86_64, ubuntu-latest) (push) Waiting to run
Build / build (make -C libretro -f Makefile -j2, clang, clang++, libretro, clang-libretro, ubuntu-latest) (push) Waiting to run
Build / build (make -C libretro -f Makefile -j2, gcc, g++, libretro, gcc-libretro, ubuntu-latest) (push) Waiting to run
Build / test (macos-latest) (push) Blocked by required conditions
Build / test (ubuntu-latest) (push) Blocked by required conditions
Build / build_test_headless_alpine (push) Waiting to run
Generate Docker Layer / build (push) Waiting to run
Some checks are pending
Build / build-windows (ARM64) (push) Waiting to run
Build / build-windows (x64) (push) Waiting to run
Build / build-uwp (push) Waiting to run
Build / test-windows (push) Blocked by required conditions
Build / build (./b.sh --headless --unittest --fat --no-png --no-sdl2, clang, clang++, test, macos, macos-latest) (push) Waiting to run
Build / build (./b.sh --headless --unittest, clang, clang++, test, clang-normal, ubuntu-latest) (push) Waiting to run
Build / build (./b.sh --headless --unittest, gcc, g++, gcc-normal, ubuntu-latest) (push) Waiting to run
Build / build (./b.sh --ios, clang, clang++, ios, ios, macos-latest) (push) Waiting to run
Build / build (./b.sh --libretro_android ppsspp_libretro, clang, clang++, android, android-libretro, ubuntu-latest) (push) Waiting to run
Build / build (./b.sh --qt, gcc, g++, qt, qt, ubuntu-latest) (push) Waiting to run
Build / build (cd android && ./ab.sh -j2 APP_ABI=arm64-v8a OPENXR=1, clang, clang++, android, android-vr, ubuntu-latest) (push) Waiting to run
Build / build (cd android && ./ab.sh -j2 APP_ABI=arm64-v8a UNITTEST=1 HEADLESS=1, clang, clang++, android, android-arm64, ubuntu-latest) (push) Waiting to run
Build / build (cd android && ./ab.sh -j2 APP_ABI=armeabi-v7a UNITTEST=1 HEADLESS=1, clang, clang++, android, android-arm32, ubuntu-latest) (push) Waiting to run
Build / build (cd android && ./ab.sh -j2 APP_ABI=x86_64 UNITTEST=1 HEADLESS=1, clang, clang++, android, android-x86_64, ubuntu-latest) (push) Waiting to run
Build / build (make -C libretro -f Makefile -j2, clang, clang++, libretro, clang-libretro, ubuntu-latest) (push) Waiting to run
Build / build (make -C libretro -f Makefile -j2, gcc, g++, libretro, gcc-libretro, ubuntu-latest) (push) Waiting to run
Build / test (macos-latest) (push) Blocked by required conditions
Build / test (ubuntu-latest) (push) Blocked by required conditions
Build / build_test_headless_alpine (push) Waiting to run
Generate Docker Layer / build (push) Waiting to run
NoticeView layout fix
This commit is contained in:
commit
aa752ade6c
@ -1813,6 +1813,7 @@ int getLocalIp(sockaddr_in* SocketAddress) {
|
||||
}
|
||||
|
||||
#else // Alternative way
|
||||
// Socket doesn't "leak" to the game.
|
||||
int sock = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
if (sock != SOCKET_ERROR) {
|
||||
const char* kGoogleDnsIp = "8.8.8.8"; // Needs to be an IP string so it can be resolved as fast as possible to IP, doesn't need to be reachable
|
||||
|
@ -1379,6 +1379,7 @@ int sceNetAdhocPdpCreate(const char *mac, int port, int bufferSize, u32 flag) {
|
||||
// Valid MAC supplied. FIXME: MAC only valid after successful attempt to Create/Connect/Join a Group? (ie. adhocctlCurrentMode != ADHOCCTL_MODE_NONE)
|
||||
if ((adhocctlCurrentMode != ADHOCCTL_MODE_NONE) && isLocalMAC(saddr)) {
|
||||
// Create Internet UDP Socket
|
||||
// Socket is remapped through adhocSockets
|
||||
int usocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
|
||||
// Valid Socket produced
|
||||
if (usocket != INVALID_SOCKET) {
|
||||
@ -3257,6 +3258,7 @@ int RecreatePtpSocket(int ptpId) {
|
||||
closesocket(sock->data.ptp.id);
|
||||
|
||||
// Create a new socket
|
||||
// Socket is remapped through adhocSockets
|
||||
int tcpsocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
|
||||
// Valid Socket produced
|
||||
@ -3375,7 +3377,8 @@ static int sceNetAdhocPtpOpen(const char *srcmac, int sport, const char *dstmac,
|
||||
|
||||
// Valid Arguments
|
||||
if (bufsize > 0 && rexmt_int > 0 && rexmt_cnt > 0) {
|
||||
// Create Infrastructure Socket
|
||||
// Create Infrastructure Socket (?)
|
||||
// Socket is remapped through adhocSockets
|
||||
int tcpsocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
|
||||
// Valid Socket produced
|
||||
@ -3977,7 +3980,8 @@ static int sceNetAdhocPtpListen(const char *srcmac, int sport, int bufsize, int
|
||||
// Valid Arguments
|
||||
if (bufsize > 0 && rexmt_int > 0 && rexmt_cnt > 0 && backlog > 0)
|
||||
{
|
||||
// Create Infrastructure Socket
|
||||
// Create Infrastructure Socket (?)
|
||||
// Socket is remapped through adhocSockets
|
||||
int tcpsocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
|
||||
// Valid Socket produced
|
||||
|
@ -321,6 +321,7 @@ int sceNetInetPoll(u32 fdsPtr, u32 nfds, int timeout) { // timeout in milisecond
|
||||
FD_ZERO(&readfds); FD_ZERO(&writefds); FD_ZERO(&exceptfds);
|
||||
for (int i = 0; i < (s32)nfds; i++) {
|
||||
if (fdarray[i].fd < 0) {
|
||||
// In Unix, this is OK and means it the fd should be ignored, except fdarray[i].revents should be zeroed.
|
||||
inetLastErrno = EINVAL;
|
||||
return hleLogError(Log::sceNet, -1, "invalid socket id");
|
||||
}
|
||||
|
@ -96,8 +96,8 @@ typedef struct SceNetInetLinger {
|
||||
// Polling Event Field
|
||||
typedef struct SceNetInetPollfd { //similar format to pollfd in 32bit (pollfd in 64bit have different size)
|
||||
s32_le fd;
|
||||
s16_le events;
|
||||
s16_le revents;
|
||||
s16_le events; // requested events
|
||||
s16_le revents; // returned events
|
||||
} PACK SceNetInetPollfd;
|
||||
|
||||
// TCP & UDP Socket Union (Internal use only)
|
||||
|
@ -77,7 +77,6 @@ static void MeasureNotice(const UIContext &dc, NoticeLevel level, const std::str
|
||||
if (!details.empty()) {
|
||||
dc.MeasureText(dc.theme->uiFont, extraTextScale, extraTextScale, details, &width2, &height2, align);
|
||||
*width = std::max(*width, width2);
|
||||
*height += 5.0f + height2;
|
||||
}
|
||||
|
||||
float iconW = 0.0f;
|
||||
@ -100,7 +99,8 @@ static void MeasureNotice(const UIContext &dc, NoticeLevel level, const std::str
|
||||
iconW += 5.0f;
|
||||
|
||||
*width += iconW + 12.0f;
|
||||
*height = std::max(*height, iconH + 5.0f);
|
||||
*height1 = std::max(*height1, iconH + 2.0f);
|
||||
*height = std::max(*height1 + height2 + 8.0f, iconH + 5.0f);
|
||||
}
|
||||
|
||||
// Align only matters here for the ASCII-only flag.
|
||||
@ -156,14 +156,17 @@ static void RenderNotice(UIContext &dc, Bounds bounds, float height1, NoticeLeve
|
||||
bounds.x += iconW + 5.0f;
|
||||
bounds.w -= iconW + 5.0f;
|
||||
|
||||
dc.DrawTextShadowRect(text, bounds.Inset(0.0f, 1.0f, 0.0f, 0.0f), foreGround, (align & FLAG_DYNAMIC_ASCII));
|
||||
Bounds primaryBounds = bounds;
|
||||
primaryBounds.h = height1;
|
||||
|
||||
dc.DrawTextShadowRect(text, primaryBounds.Inset(2.0f, 0.0f, 1.0f, 0.0f), foreGround, (align & FLAG_DYNAMIC_ASCII) | ALIGN_VCENTER);
|
||||
|
||||
if (!details.empty()) {
|
||||
Bounds bottomTextBounds = bounds.Inset(3.0f, height1 + 5.0f, 3.0f, 3.0f);
|
||||
UI::Drawable backgroundDark = UI::Drawable(colorAlpha(darkenColor(GetNoticeBackgroundColor(level)), alpha));
|
||||
dc.FillRect(backgroundDark, bottomTextBounds);
|
||||
dc.SetFontScale(extraTextScale, extraTextScale);
|
||||
dc.DrawTextRect(details, bottomTextBounds, foreGround, (align & FLAG_DYNAMIC_ASCII) | ALIGN_LEFT);
|
||||
dc.DrawTextRect(details, bottomTextBounds.Inset(1.0f, 1.0f), foreGround, (align & FLAG_DYNAMIC_ASCII) | ALIGN_LEFT);
|
||||
}
|
||||
dc.SetFontScale(1.0f, 1.0f);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user