Posted By: Reconnoiter
add_resource invalid pointer error - 05/12/17 10:44
Hey everyone,
I am trying to open the game wrs file within the map editor for the game. But I got an invalid pointer error with add_resource in the code below (don't really understand why):
(note: for some reason the code tags seem to convert double backslash to single backslash)
I am trying to open the game wrs file within the map editor for the game. But I got an invalid pointer error with add_resource in the code below (don't really understand why):
(note: for some reason the code tags seem to convert double backslash to single backslash)
Code:
char* wrs_buffer;
int wrs_size = 0;
...
void blablabla () {
wrs_buffer = file_load("D:\GStudio8\just a subfolder\MyGame\mygame.wrs", &wrs_size, &wrs_size);
if (wrs_size > 0) {
error("wrs found"); <- check
add_resource(wrs_buffer); <- gives invalid pointer error
...