Vita: Connecting to multiplayer works probably

This commit is contained in:
UnknownShadow200 2023-09-03 11:38:32 +10:00
parent 11b96ef7e5
commit 5a4827f034
2 changed files with 8 additions and 6 deletions

View File

@ -61,7 +61,7 @@ static void guInit(void) {
sceGuScissor(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
sceGuDisable(GU_SCISSOR_TEST);
sceGuEnable(GU_CLIP_PLANES);
sceGuEnable(GU_CLIP_PLANES); // TODO: swap near/far instead of this?
sceGuTexFunc(GU_TFX_MODULATE, GU_TCC_RGBA);
sceGuFinish();
@ -217,6 +217,7 @@ void Gfx_CalcPerspectiveMatrix(struct Matrix* matrix, float fov, float aspect, f
matrix->row3.W = -1.0f;
matrix->row4.Z = -(2.0f * zFar * zNear) / (zFar - zNear);
matrix->row4.W = 0.0f;
// TODO: should direct3d9 one be used insted with clip range from -1,1 ?
}

View File

@ -354,15 +354,16 @@ static cc_result Socket_Poll(cc_socket s, int mode, cc_bool* success) {
SceNetEpollEvent ev = { 0 };
// to match select, closed socket still counts as readable
int flags = mode == SOCKET_POLL_READ ? (SCE_NET_EPOLLIN | SCE_NET_EPOLLHUP) : SCE_NET_EPOLLOUT;
int res;
int res, num_events;
ev.data.fd = s;
ev.events = flags;
if ((res = sceNetEpollControl(epoll_id, SCE_NET_EPOLL_CTL_ADD, s, &ev))) return res;
res = sceNetEpollWait(epoll_id, &ev, 1, 0);
if ((res = sceNetEpollControl(epoll_id, SCE_NET_EPOLL_CTL_ADD, s, &ev))) return res;
num_events = sceNetEpollWait(epoll_id, &ev, 1, 0);
sceNetEpollControl(epoll_id, SCE_NET_EPOLL_CTL_DEL, s, NULL);
if (res) return res;
if (num_events < 0) return num_events;
if (num_events == 0) return ERR_NOT_SUPPORTED; // TODO when can this ever happen?
*success = (ev.events & flags) != 0;
return 0;