Gamestudio Links
Zorro Links
Newest Posts
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
M1 Oversampling
by 11honza11. 04/20/24 20:57
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (rki), 405 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
add_resource invalid pointer error #465786
05/12/17 10:44
05/12/17 10:44
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
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)

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
...


Re: add_resource invalid pointer error [Re: Reconnoiter] #465792
05/12/17 14:16
05/12/17 14:16
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
I do successfully use to add resource as follows:
Code:
add_resource ( "data\\animations.wrs" );


but now I read manuals example crazy

Re: add_resource invalid pointer error [Re: txesmi] #465796
05/12/17 17:13
05/12/17 17:13
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Okay now I do it directly:
add_resource("D:GStudio8just a subfolderMyGamemygame.wrs");
and that does work lol. Weird acknex bug or such? Anyway do we still need to free(); the buffer?

Re: add_resource invalid pointer error [Re: Reconnoiter] #465816
05/14/17 06:13
05/14/17 06:13
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
Actually, it is not needed to preload a buffer. 'acklog' says nothing about unfreed memory at the end so... Thats all I can say laugh

Re: add_resource invalid pointer error [Re: txesmi] #465819
05/14/17 09:50
05/14/17 09:50
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline OP
Serious User
Reconnoiter  Offline OP
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Originally Posted By: txesmi
Actually, it is not needed to preload a buffer. 'acklog' says nothing about unfreed memory at the end so... Thats all I can say laugh
, tnx for the check laugh


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1