1 less error when compiling as C++

also fix mistake in readme (thanks kylbert)
This commit is contained in:
UnknownShadow200 2020-08-12 21:48:19 +10:00
parent 7c977a275b
commit 2016b4ef7f
4 changed files with 7 additions and 10 deletions

View File

@ -18,7 +18,7 @@ It **does not** work with 'modern/premium' Minecraft servers.
* macOS: macOS 10.5 or later. (Can be compiled to work with 10.3/10.4 though)
* Linux: libcurl and libopenal.
**Note:** When running from within VirtualBox, disable Mouse Integration, otherwise the camera will not work propery.
**Note:** When running from within VirtualBox, disable Mouse Integration, otherwise the camera will not work properly.
#### Instructions
Initially, you will need to run ClassiCube.exe to download the required assets from minecraft.net.

View File

@ -128,7 +128,7 @@ static void Http_Add(const String* url, cc_bool priority, const String* id, cc_u
req.size = size;
}
req.cookies = cookies;
req.timeAdded = DateTime_CurrentUTC_MS();
req._timeAdded = Stopwatch_Measure();
Mutex_Lock(pendingMutex);
{
@ -193,7 +193,7 @@ static void Http_CompleteRequest(struct HttpRequest* req) {
if (index >= 0) {
/* very rare case - priority item was inserted, then inserted again (so put before first item), */
/* and both items got downloaded before an external function removed them from the queue */
if (older.timeAdded > req->timeAdded) {
if (older._timeAdded > req->_timeAdded) {
HttpRequest_Free(req);
} else {
/* normal case, replace older req */

View File

@ -22,7 +22,7 @@ enum HttpProgress {
struct HttpRequest {
char url[URL_MAX_SIZE]; /* URL data is downloaded from/uploaded to. */
char id[URL_MAX_SIZE]; /* Unique identifier for this request. */
TimeMS timeAdded; /* Time this request was added to queue of requests. */
cc_uint64 _timeAdded; /* Timestamp this request was added to requests queue. */
TimeMS timeDownloaded; /* Time response contents were completely downloaded. */
int statusCode; /* HTTP status code returned in the response. */
cc_uint32 contentLength; /* HTTP content length returned in the response. */

View File

@ -1458,11 +1458,8 @@ static void CPE_DefineModel(cc_uint8* data) {
}
cm->numParts = numParts;
cm->model.vertices = Mem_AllocCleared(
numParts * MODEL_BOX_VERTICES,
sizeof(struct ModelVertex),
"CustomModel vertices"
);
cm->model.vertices = (struct ModelVertex*)Mem_AllocCleared(numParts * MODEL_BOX_VERTICES,
sizeof(struct ModelVertex), "CustomModel vertices");
cm->defined = true;
}