Creates the linked lists for the drawable dynamic and static actors. This function is automatically called by Resolutionary, if resAddActorObject();
is trying to add an actor to an empty list.
Important
This function should not be called manually. Using the function incorrectly can lead to a memory leak.
A pointer to the first actor object added to the new list, NULL
on failure.
resCreateActorObjectList(&collide); // Add collide actor to the list as its first object
Adds an actor to the list of drawable actors.
A pointer to the actor object added to the list, NULL
on failure.
resAddActorObject(&collide); // Add collide actor to the list
Searches an actor object from the drawable actor list and also gives a pointer to the previous actor object in the list.
Important
This function returns two values. The second value, a pointer to the preceding object in the list, is returned via the argument prev
.
NULL
A pointer to the actor object that corresponds to the given actor, NULL
if no match found. Also returns a pointer to the preceding object in the list, this pointer is returned via the argument prev
.
resActorObject *del = NULL; // Pointer to the actor object to delete
resActorObject *prev = NULL; // Pointer to the previous actor object in the list
del = resSearchActorObject(&getclone(clonename), &prev); // Find del and prev
resDeleteActorObjectByPointer(del, prev); // Delete the actor object that represents the current actor
Deletes a given actor's corresponding actor object from the list and frees the memory allocated for it.
1 on success, 0 if no corresponding actor object was found for the given actor
resDeleteActorObject(&getclone(clonename)); // Delete the actor object that represents the current actor
Deletes given actor object from the list and frees the memory allocated for it.
NULL
if there's none)
1 on success, 0 if del
is NULL
resActorObject *del = NULL; // Pointer to the actor object to delete
resActorObject *prev = NULL; // Pointer to the previous actor object in the list
del = resSearchActorObject(&getclone(clonename), &prev); // Find del and prev
resDeleteActorObjectByPointer(del, prev); // Delete the actor object that represents the current actor
Removes an actor object's linking from the list. This function is called by Resolutionary when deleting an actor object.
Important
This function should not be called manually. Using the function incorrectly can lead to a memory leak.
NULL
if there's none)
1 on success, 0 if del
is NULL
resActorObject *del = NULL; // Pointer to the actor object to delete
resActorObject *prev = NULL; // Pointer to the previous actor object in the list
del = resSearchActorObject(&getclone(clonename), &prev); // Find del and prev
resUnlinkActorObject(del, prev); // Unlink the actor object that represents the current actor
if (del) // If a corresponding actor object was actually found
free(del); // Free the memory allocated for the actor object that represents the current actor
del = NULL; // Clear pointer
Deletes all actor objects in the lists and frees the memory allocated for them.
resDeleteActorObjectLists(); // Delete all actor objects and free all memory allocated for them
Draws the dynamic layer.
resDrawDynamicLayer(); // Draw the dynamic layer
Draws the static layer.
resDrawStaticLayer(); // Draw the static layer
Sends an activation event to the static layer canvas.
resSendStaticLayerActivationEvent(); // Send activation event to the static layer canvas
Handles the static layer canvas' activation events.
resSendStaticLayerActivationEvent(); // Handle the activation event
Draws the debug overlay that shows the following information:
Important
The debug overlay can only be drawn if the constant RES_DEBUG
is 1.
resDisplayDebugOverlay(); // Display the debug overlay
Updates Resolutionary's mouse position. Also updates the variables resXmouse
and resYmouse
that should be used for reading mouse position instead of the usual xmouse
and ymouse
.
resUpdateMouse(); // Update Resolutionary's mouse
Updates the variable that holds the state of the given mouse button when the button is pressed down, and sends an activation event to all actors found in the current mouse actor position. The function also finds the actor with highest z depth at the mouse position, this information is used for allowing the system to simulate Game Editor's normal mouse behavior, where only the top actor can be clicked.
0 on success, 1 if no actors in collision (i.e. nothing to click), 2 if memory allocation failed
resUpdateMouseButtonDown(RES_MOUSE_LEFT); // Update the status of left mouse button to pressed down
Updates the variable that holds the state of the given mouse button when the button is released, and sends an activation event to all actors that were found in the mouse actor's position when the button was pressed down.
resUpdateMouseButtonUp(RES_MOUSE_LEFT); // Update the status of left mouse button to released
This function can be used to concatenate a string to another without having to worry about overflowing the destination string. If there's not enough space in the destination string, the function concatenates as many characters from the beginning of the source string as there is space for before the string has to be null terminated. Rest of the source string is cropped out of the concatenation.
0 on success, 1 if some of the source string had to be cropped from concatenation
char myString[30] = "This is a string.";
char *addThis = " This is another string, a longer one.";
int cropOccured = 0;
cropOccured = resSafeStrcat(myString, addThis, sizeof myString); // Concatenate as much of addThis to myString as possible
sprintf(text, "myString: %s\ncropOccured: %i", myString, cropOccured);
// Will print:
// myString: This is a string. This is ano
// cropOccured: 1
Limits a value between given boundaries.
If the given value is between the limit values, it is returned as it is, otherwise returns the exceeded limit value
x = resLimit(x, -100, 100); // Limit current actor's x between -100 and 100
Disables all mouse events of a given actor.
resDisableMouseEvents("Event Actor"); // Disable current actor's mouse events
Enables all mouse events of a given actor.
resEnableMouseEvents("Event Actor"); // Enable current actor's mouse events
Checks if an actor exists or not.
1 if actor exists, 0 if not
if (!resCheckActorExistence("myActor")) // If myActor doesn't exist
{
DestroyActor("Event Actor"); // Destroy current actor
}
Checks if a given actor has already been added to either one of the drawable actor lists.
1 if actor is on a list, 0 if not
if (!resActorIsListed(&collide)) // If collide actor is not listed yet
resAddActorObject(&collide); // Add it
This site uses Google code-prettify for syntax highlighting. Prettify is distributed under the Apache 2.0 License and is Copyright (C) 2011 Google Inc.