Post Reply 
BLIT_P gives different results (Calc vs. Emu.)
05-01-2016, 04:40 PM
Post: #1
BLIT_P gives different results (Calc vs. Emu.)
Version 10077:

This could be something I am missing but I am trying to fill the screen with trees using grobs. On the calculator the program works fine but the emulator shows a blank screen.

Code:
EXPORT IMGforest()
BEGIN
// draw a forest
// EWS 2016-04-25

// clear the screen
RECT_P();
RECT_P(G1);

// colors
LOCAL gr:=#009E60h,br:=#964B00h;

// draw a tree on G1

// use pixels (0,0) to (15,15)
// stump
FILLPOLY_P(G1,{(5,6),(5,15),
(9,15),(9,6)},br);
// tree
FILLPOLY_P(G1,
{(0,4),(7,0),(15,4),(9,3),
(15,6),(9,5),(15,12),(7,9),
(0,12),(5,5),(0,9),(5,3)},gr);

// plant the forest
LOCAL I,J;
FOR J FROM 0 TO 208 STEP 16 DO
FOR I FROM 0 TO 304 STEP 16 DO
BLIT_P(G0,I,J,I+15,J+15,
G1,0,0,15,15);
END; END;


WAIT;
END;

Anyone know what I am missing? Using FREEZE instead of WAIT gives the same results.


Attached File(s) Thumbnail(s)
   
Visit this user's website Find all posts by this user
Quote this message in a reply
05-02-2016, 05:59 AM
Post: #2
RE: BLIT_P gives different results (Calc vs. Emu.)
Just add this line before RECT_P(G1)
Code:
DIMGROB_P(G1,20,20);
By default the GROB G1 may be not defined and you should always set the dimensions.
It is unnecessary for G0 but for G1-G9 it shold be defined before first use.

Piotr Kowalewski
Radioactive Wastes - game for HP Prime
Find all posts by this user
Quote this message in a reply
05-02-2016, 06:22 AM
Post: #3
RE: BLIT_P gives different results (Calc vs. Emu.)
Hello,

You are not dimentionning your G1... in the emulator, I assume that it is of size 0*0. but for some reasons (you had an earlier program running), it does have a dimension on the calculator.

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)