Author Topic: Custom Edit Image, Save and Load with Turkey Hunt WIP Game  (Read 2676 times)

0 Members and 1 Guest are viewing this topic.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
Re: Custom Edit Image, Save and Load with Turkey Hunt WIP Game
« Reply #15 on: January 09, 2022, 03:36:49 pm »
Hi Petr,

Love your new avatar! ;-))

Yeah does seem a faster paint what did you do? Whiles instead or For's maybe?

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
Re: Custom Edit Image, Save and Load with Turkey Hunt WIP Game
« Reply #16 on: January 09, 2022, 03:55:37 pm »
I made some adjustments there. I think While statement is as fast as Do, they're both faster than For, so I didn't change that. The known brake is Point, so I replaced it with MemGet, instead of PSet I used MemPut. Next, before analyzing the image, I saved it as a user-defined RGB field - one index = one pixel. So that RED32, GREEN32 and BLUE32 are still not called. The color components for fill color is made it global like NGreen, NBlue and NRed (all types _unsigned _byte).

I've found that if you add DefLng A-Z to my and your source code at the beginning, it will accelerate further in both cases.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
Re: Custom Edit Image, Save and Load with Turkey Hunt WIP Game
« Reply #17 on: January 09, 2022, 06:37:16 pm »
I made some adjustments there. I think While statement is as fast as Do, they're both faster than For, so I didn't change that. The known brake is Point, so I replaced it with MemGet, instead of PSet I used MemPut. Next, before analyzing the image, I saved it as a user-defined RGB field - one index = one pixel. So that RED32, GREEN32 and BLUE32 are still not called. The color components for fill color is made it global like NGreen, NBlue and NRed (all types _unsigned _byte).

I've found that if you add DefLng A-Z to my and your source code at the beginning, it will accelerate further in both cases.

Excellent! Thanks, I'll incorporate those changes into Editor I have on ToDo List.