aboutsummaryrefslogtreecommitdiff
path: root/src/utils.c
diff options
context:
space:
mode:
authorReece Mackie <20544390+Rover656@users.noreply.github.com>2019-04-27 21:59:01 +0100
committerReece Mackie <20544390+Rover656@users.noreply.github.com>2019-04-27 21:59:01 +0100
commite0580e6322236f03c75ff8088c98bc079ac8ca95 (patch)
tree14004b760d8a1e1df4ba076e36d5a23ff8da7633 /src/utils.c
parentc1f33eb817765ad801b2419d86457a6102b64032 (diff)
parentf70a640b2db343d48e465013cacb304f8dabebcb (diff)
downloadraylib-e0580e6322236f03c75ff8088c98bc079ac8ca95.tar.gz
raylib-e0580e6322236f03c75ff8088c98bc079ac8ca95.zip
Fix merge
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c63
1 files changed, 25 insertions, 38 deletions
diff --git a/src/utils.c b/src/utils.c
index c886d2a7..52fd0b45 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -205,73 +205,64 @@ static int android_close(void *cookie)
#if defined(PLATFORM_UWP)
-#define MAX_MESSAGES 512 //If there are over 128 messages, I will cry... either way, this may be too much EDIT: Welp, 512
+#define MAX_MESSAGES 512 // If there are over 128 messages, I will cry... either way, this may be too much EDIT: Welp, 512
-static int UWPOutMessageId = -1; //Stores the last index for the message
-static UWPMessage* UWPOutMessages[MAX_MESSAGES]; //Messages out to UWP
+static int UWPOutMessageId = -1; // Stores the last index for the message
+static UWPMessage* UWPOutMessages[MAX_MESSAGES]; // Messages out to UWP
-static int UWPInMessageId = -1; //Stores the last index for the message
-static UWPMessage* UWPInMessages[MAX_MESSAGES]; //Messages in from UWP
+static int UWPInMessageId = -1; // Stores the last index for the message
+static UWPMessage* UWPInMessages[MAX_MESSAGES]; // Messages in from UWP
UWPMessage* CreateUWPMessage(void)
{
- UWPMessage* msg = (UWPMessage*)RL_MALLOC(sizeof(UWPMessage));
- msg->Type = None;
- Vector2 v0 = {0, 0};
- msg->Vector0 = v0;
- msg->Int0 = 0;
- msg->Int1 = 0;
- msg->Char0 = 0;
- msg->Float0 = 0;
- msg->Double0 = 0;
- msg->Bool0 = false;
+ UWPMessage *msg = (UWPMessage *)RL_MALLOC(sizeof(UWPMessage));
+ msg->type = UWP_MSG_NONE;
+ Vector2 v0 = { 0, 0 };
+ msg->paramVector0 = v0;
+ msg->paramInt0 = 0;
+ msg->paramInt1 = 0;
+ msg->paramChar0 = 0;
+ msg->paramFloat0 = 0;
+ msg->paramDouble0 = 0;
+ msg->paramBool0 = false;
return msg;
}
-void DeleteUWPMessage(UWPMessage* msg)
+void DeleteUWPMessage(UWPMessage *msg)
{
RL_FREE(msg);
}
bool UWPHasMessages(void)
{
- return UWPOutMessageId > -1;
+ return (UWPOutMessageId > -1);
}
-UWPMessage* UWPGetMessage(void)
+UWPMessage *UWPGetMessage(void)
{
- if (UWPHasMessages())
- {
- return UWPOutMessages[UWPOutMessageId--];
- }
+ if (UWPHasMessages()) return UWPOutMessages[UWPOutMessageId--];
return NULL;
}
-void UWPSendMessage(UWPMessage* msg)
+void UWPSendMessage(UWPMessage *msg)
{
if (UWPInMessageId + 1 < MAX_MESSAGES)
{
UWPInMessageId++;
UWPInMessages[UWPInMessageId] = msg;
}
- else
- {
- TraceLog(LOG_WARNING, "[UWP Messaging] Not enough array space to register new UWP inbound Message.");
- }
+ else TraceLog(LOG_WARNING, "[UWP Messaging] Not enough array space to register new UWP inbound Message.");
}
-void SendMessageToUWP(UWPMessage* msg)
+void SendMessageToUWP(UWPMessage *msg)
{
if (UWPOutMessageId + 1 < MAX_MESSAGES)
{
UWPOutMessageId++;
UWPOutMessages[UWPOutMessageId] = msg;
}
- else
- {
- TraceLog(LOG_WARNING, "[UWP Messaging] Not enough array space to register new UWP outward Message.");
- }
+ else TraceLog(LOG_WARNING, "[UWP Messaging] Not enough array space to register new UWP outward Message.");
}
bool HasMessageFromUWP(void)
@@ -281,12 +272,8 @@ bool HasMessageFromUWP(void)
UWPMessage* GetMessageFromUWP(void)
{
- if (HasMessageFromUWP())
- {
- return UWPInMessages[UWPInMessageId--];
- }
+ if (HasMessageFromUWP()) return UWPInMessages[UWPInMessageId--];
return NULL;
}
-
-#endif
+#endif // defined(PLATFORM_UWP)