A bug in screen_get ?

Started by Breadcaster, June 09, 2016, 07:01:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Breadcaster

Hello all, hello hello hello.

So I've seen this done a million times in before, and I'm sure you all have as well :) Where ingame, there's a TV screen or a display of some kind which shows exactly what the player's looking at, using the screen_get function. In DIV, this would of originally been screen_copy.

I've got it working just fine in my game at present, except that every now and again, it causes a random crash - the game will quit and I'll get the "blabla has encountered a problem and needs to close" Windows box pop up.

Before the loop/just after the Begin, I have this code:

displayscreen_graph=map_new(73, 55, 16);
playersscreen_graph=screen_get();
map_xput(0, displayscreen_graph, playersscreen_graph, 36, 27, 0, 15, 0);
graph=displayscreen_graph;

and then in the main process loop, this code:

playersscreen_graph=screen_get(); // Crash
map_xput(0, displayscreen_graph, playersscreen_graph, 36, 27, 0, 15, 0);
graph=displayscreen_graph;
Frame;

For some reason, the line I've commented with "Crash" makes the game, well, crash. Commenting it out/removing it and running the game works just fine (except the screen doesn't update beyond the first frame of course).

Has anyone here had any experience with it, any why this might be crashing the game? I've searched the forum and, of course, all the relevant results I can find are in Spanish, haha. Is Screen_copy still in Bennu or has it been replaced entirely by screen_get?

The game's very near completion and it's a blast to play, I'm sure you'll enjoy it when it's done :)

Thank you for your help!!

- Breadcaster

Drumpi

Just to be sure, did you remember to UNLOAD the captured screen every frame?
The mensaje error "blabla has encountered a problem and needs to close" comes with an exception code. What code is it? just to know if it's an overflow error or access violation or other kind of error.
Hala, como con 1001 procesos sólo va a 9 FPS, vamos a meterle 32 veces más, a ver si revienta.
(Drumpi epic moment)

Breadcaster

I didn't, that fixed it - thank you! I was treating it like screen_copy() from the original DIV, haha. Didn't realise it needed to be unloaded. :)