summaryrefslogtreecommitdiffhomepage
path: root/src/utils.c
diff options
context:
space:
mode:
authorRay <[email protected]>2020-01-08 18:21:08 +0100
committerRay <[email protected]>2020-01-08 18:21:08 +0100
commit4211056354c66f90702508bb78631a0947d57a1f (patch)
tree15fba737cdaa2f8fde83f4e1192f771e23eebcf2 /src/utils.c
parent6d56c99a37df6b399d871d79ff7c48cf9a85884d (diff)
downloadraylib-4211056354c66f90702508bb78631a0947d57a1f.tar.gz
raylib-4211056354c66f90702508bb78631a0947d57a1f.zip
Reviewed some comments
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/utils.c b/src/utils.c
index 2988cbf8..55b85cbe 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -52,17 +52,26 @@
#define MAX_TRACELOG_BUFFER_SIZE 128 // Max length of one trace-log message
+#define MAX_UWP_MESSAGES 512 // Max UWP messages to process
+
//----------------------------------------------------------------------------------
// Global Variables Definition
//----------------------------------------------------------------------------------
// Log types messages
-static int logTypeLevel = LOG_INFO;
-static int logTypeExit = LOG_ERROR;
-static TraceLogCallback logCallback = NULL;
+static int logTypeLevel = LOG_INFO; // Minimum log type level
+static int logTypeExit = LOG_ERROR; // Log type that exits
+static TraceLogCallback logCallback = NULL; // Log callback function pointer
#if defined(PLATFORM_ANDROID)
-AAssetManager *assetManager = NULL;
+static AAssetManager *assetManager = NULL; // Android assets manager pointer
+#endif
+
+#if defined(PLATFORM_UWP)
+static int UWPOutMessageId = -1; // Last index of output message
+static UWPMessage *UWPOutMessages[MAX_UWP_MESSAGES]; // Messages out to UWP
+static int UWPInMessageId = -1; // Last index of input message
+static UWPMessage *UWPInMessages[MAX_UWP_MESSAGES]; // Messages in from UWP
#endif
//----------------------------------------------------------------------------------
@@ -204,16 +213,7 @@ static int android_close(void *cookie)
#endif // PLATFORM_ANDROID
#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
-
-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
-
-UWPMessage* CreateUWPMessage(void)
+UWPMessage *CreateUWPMessage(void)
{
UWPMessage *msg = (UWPMessage *)RL_MALLOC(sizeof(UWPMessage));
msg->type = UWP_MSG_NONE;
@@ -247,7 +247,7 @@ UWPMessage *UWPGetMessage(void)
void UWPSendMessage(UWPMessage *msg)
{
- if (UWPInMessageId + 1 < MAX_MESSAGES)
+ if ((UWPInMessageId + 1) < MAX_UWP_MESSAGES)
{
UWPInMessageId++;
UWPInMessages[UWPInMessageId] = msg;
@@ -257,7 +257,7 @@ void UWPSendMessage(UWPMessage *msg)
void SendMessageToUWP(UWPMessage *msg)
{
- if (UWPOutMessageId + 1 < MAX_MESSAGES)
+ if ((UWPOutMessageId + 1) < MAX_UWP_MESSAGES)
{
UWPOutMessageId++;
UWPOutMessages[UWPOutMessageId] = msg;
@@ -270,7 +270,7 @@ bool HasMessageFromUWP(void)
return UWPInMessageId > -1;
}
-UWPMessage* GetMessageFromUWP(void)
+UWPMessage *GetMessageFromUWP(void)
{
if (HasMessageFromUWP()) return UWPInMessages[UWPInMessageId--];