Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > PocketBook > PocketBook Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 10-10-2021, 01:39 PM   #31
Skeeve
Zealot
Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.
 
Skeeve's Avatar
 
Posts: 142
Karma: 669192
Join Date: Nov 2013
Device: Kindle 4.1.1 no touch
You are right. pbres does not work

Code:
root@5f2a011857ca:/project# make
LC_ALL=C /pocketbook-sdk/SDK_481/bin/pbres -c ./icons/icons.c -4 icons/app_icons/icon_type_tap.bmp icons/app_icons/icon_home.bmp icons/app_icons/icon_menu_tap.bmp icons/app_icons/ic_star.bmp icons/app_icons/icon_settings.bmp icons/app_icons/icon_back_tap.bmp icons/app_icons/icon_redraw.bmp icons/app_icons/icon_game.bmp icons/app_icons/icon_type.bmp icons/app_icons/icon_menu.bmp icons/app_icons/icon_home_tap.bmp icons/app_icons/icon_back.bmp icons/app_icons/icon_redraw_tap.bmp icons/app_icons/icon_settings_tap.bmp icons/app_icons/icon_game_tap.bmp icons/game_icons/game_mathrax.bmp icons/game_icons/game_sokoban.bmp icons/game_icons/game_lightup.bmp icons/game_icons/game_clusters.bmp icons/game_icons/game_spokes.bmp icons/game_icons/game_group.bmp icons/game_icons/game_tents.bmp icons/game_icons/game_loopy.bmp icons/game_icons/game_galaxies.bmp icons/game_icons/game_cube.bmp icons/game_icons/game_netslide.bmp icons/game_icons/game_mines.bmp icons/game_icons/game_creek.bmp icons/game_icons/game_range.bmp icons/game_icons/game_rome.bmp icons/game_icons/game_samegame.bmp icons/game_icons/game_unruly.bmp icons/game_icons/game_magnets.bmp icons/game_icons/game_twiddle.bmp icons/game_icons/game_dominosa.bmp icons/game_icons/game_sticks.bmp icons/game_icons/game_inertia.bmp icons/game_icons/game_unequal.bmp icons/game_icons/game_filling.bmp icons/game_icons/game_map.bmp icons/game_icons/game_slant.bmp icons/game_icons/game_flood.bmp icons/game_icons/game_pearl.bmp icons/game_icons/game_pattern.bmp icons/game_icons/game_flip.bmp icons/game_icons/game_untangle.bmp icons/game_icons/game_mosaic.bmp icons/game_icons/game_guess.bmp icons/game_icons/game_slide.bmp icons/game_icons/game_singles.bmp icons/game_icons/game_ascent.bmp icons/game_icons/game_bridges.bmp icons/game_icons/game_keen.bmp icons/game_icons/game_undead.bmp icons/game_icons/game_sixteen.bmp icons/game_icons/game_pegs.bmp icons/game_icons/game_rect.bmp icons/game_icons/game_net.bmp icons/game_icons/game_walls.bmp icons/game_icons/game_signpost.bmp icons/game_icons/game_towers.bmp icons/game_icons/game_boats.bmp icons/game_icons/game_blackbox.bmp icons/game_icons/game_tracks.bmp icons/game_icons/game_solo.bmp icons/game_icons/game_abcd.bmp icons/game_icons/game_fifteen.bmp icons/game_icons/game_salad.bmp icons/game_icons/game_palisade.bmp icons/configuration/cfg_decr.bmp icons/configuration/cfg_difficulty.bmp icons/configuration/cfg_no.bmp icons/configuration/cfg_incr.bmp icons/configuration/cfg_decr_tap.bmp icons/configuration/cfg_on.bmp icons/configuration/cfg_yes.bmp icons/configuration/cfg_off.bmp icons/configuration/cfg_incr_tap.bmp icons/menu_icons/menu_exit.bmp icons/menu_icons/menu_help.bmp icons/menu_icons/menu_new.bmp icons/menu_icons/menu_solve.bmp icons/menu_icons/menu_star.bmp icons/menu_icons/menu_restart.bmp icons/menu_icons/menu_settings.bmp icons/menu_icons/menu_reset.bmp icons/controls/bt_net_shuffle.bmp icons/controls/bt_swap.bmp icons/controls/bt_salad_o.bmp icons/controls/bt_guess_i.bmp icons/controls/bt_remove.bmp icons/controls/bt_map_j.bmp icons/controls/bt_west.bmp icons/controls/bt_map_c.bmp icons/controls/bt_undo_d.bmp icons/controls/bt_south.bmp icons/controls/bt_page.bmp icons/controls/bt_bridges_g.bmp icons/controls/bt_undead_g.bmp icons/controls/bt_add.bmp icons/controls/bt_redo.bmp icons/controls/bt_redo_d.bmp icons/controls/bt_fill_map.bmp icons/controls/bt_fill_marks.bmp icons/controls/bt_undo.bmp icons/controls/bt_salad_x.bmp icons/controls/bt_fill_nums.bmp icons/controls/bt_undead_z.bmp icons/controls/bt_east.bmp icons/controls/bt_north.bmp icons/controls/bt_fill_rome.bmp icons/controls/bt_backspace.bmp icons/controls/bt_undead_v.bmp icons/controls/bt_page_select.bmp
Error: canot stat icons/app_icons/icon_type_tap.bmp

make: *** [Makefile:34: icons/icons.c] Error 1
Strangely enough: All the icon files are there and readable:

Code:
root@5ddc376448f1:/project# ls -al icons/app_icons/icon_type_tap.bmp
-rw-r--r-- 1 root root 10362 Oct  6 11:17 icons/app_icons/icon_type_tap.bmp
Maybe it's still a 32 vs. 64bit issue? But then: Would pbres not fail directly?

Unfortunately an "empty" icons.c is created, when pbres was run.
Code:
typedef struct ibitmap_s {
	short width;
	short height;
	short depth;
	short scanline;
	unsigned char data[];
} ibitmap;
So that the next "make" will run and fail as shown.

My Dockerfile can be found here: https://github.com/Skeeve/PocketPuzz...ure/Dockerfile

The call I use, as long as I'm experimenting is:

Code:
docker build -t pbdev .
docker run --rm -it --mount type=bind,source="$(pwd)",target=/project pbdev
Skeeve is offline   Reply With Quote
Old 10-10-2021, 02:50 PM   #32
Skeeve
Zealot
Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.
 
Skeeve's Avatar
 
Posts: 142
Karma: 669192
Join Date: Nov 2013
Device: Kindle 4.1.1 no touch
FYI: I tried the 5.19 SDK and there pbres works. But I have to get the rest of it running.
Skeeve is offline   Reply With Quote
Old 10-10-2021, 06:31 PM   #33
Skeeve
Zealot
Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.
 
Skeeve's Avatar
 
Posts: 142
Karma: 669192
Join Date: Nov 2013
Device: Kindle 4.1.1 no touch
SUCCESS!

I got it to compile with my latest update, using the 6.3 (5.19) SDK mentioned by @rkomar.

It's "hacky" as I didn't bother to create a proper cmake file, thus using the cmake toolchain file provided by the SDK.

I did just one small change to your makefile in order to include freetype2.

Please see the adjusted README for details.
Skeeve is offline   Reply With Quote
Old 10-11-2021, 07:43 AM   #34
Skeeve
Zealot
Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.
 
Skeeve's Avatar
 
Posts: 142
Karma: 669192
Join Date: Nov 2013
Device: Kindle 4.1.1 no touch
I also now copied the compiled program to my HD3 and it worked.
Skeeve is offline   Reply With Quote
Old 10-11-2021, 11:42 AM   #35
GerReader
Connoisseur
GerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of it
 
Posts: 50
Karma: 66200
Join Date: Oct 2020
Location: Germany, Rhein-Main
Device: PocketBook Touch HD 3
Quote:
Originally Posted by Skeeve View Post
I also now copied the compiled program to my HD3 and it worked.
Very good work!
GerReader is offline   Reply With Quote
Old 10-11-2021, 03:41 PM   #36
GerReader
Connoisseur
GerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of it
 
Posts: 50
Karma: 66200
Join Date: Oct 2020
Location: Germany, Rhein-Main
Device: PocketBook Touch HD 3
@Skeeve: How to implement automatic cell highlight switching

@Skeeve,

As mentioned in the main thread, here a sketch what needs to be done to implement your proposed improvement to the app. I assume you never contributed to the original SGT puzzle collection, so I need to explain some details how the API works.

a) You need to add a new control code for the event "short/long swap key changed", in "puzzles.h" at the enum from line 29 on, either after CURSOR_SELECT2, or after UI_UPPER_BOUND.

b) At line 564 in frontend/game.c you call "midend_process_key(me, 0, 0, UI_SWAPCHANGE, fe->swapped);" to pass the swap change event to the "midend" (which is the software layer between the frontend and the individual game, its purpose is to manage things like the undo/redo list and a lot of other service functions)

c) The midend will call "interpret_move" in the game file with this control code; in Solo this is at line 4009.
The interpret_move function will receive the raw input, either pixel coordinates when the game area was clicked, or control/button codes when a button was clicked. There you need to catch the swap change, and adjust the current highlight mode in the "game_ui *ui" struct.
After adjusting the highlight mode, return from interpret_move with the return value UI_UPDATE.

The function docs for interpret_move is found here:

https://www.chiark.greenend.org.uk/~...interpret-move

I would return with UI_UPDATE in your case, as the UI needs to be updated, but the switch between full / pencil mark highlight mode is not worth to be included in the undo/redo list.

For further information, the original SGT project development documentation is here:

https://www.chiark.greenend.org.uk/~...puzzles/devel/

Happy coding!
GerReader is offline   Reply With Quote
Old 10-15-2021, 10:27 AM   #37
Skeeve
Zealot
Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.
 
Skeeve's Avatar
 
Posts: 142
Karma: 669192
Join Date: Nov 2013
Device: Kindle 4.1.1 no touch
Hi Steffen.
Quote:
Originally Posted by GerReader View Post
Happy coding!
Despite it sounding quite complicated, I managed to implement it.

Your description was fantastic!

Shall I create a pull request?

Shall I also create one for my dockerfile?
Skeeve is offline   Reply With Quote
Old 10-18-2021, 11:03 AM   #38
GerReader
Connoisseur
GerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of itGerReader has read War And Peace ... all of it
 
Posts: 50
Karma: 66200
Join Date: Oct 2020
Location: Germany, Rhein-Main
Device: PocketBook Touch HD 3
Quote:
Originally Posted by Skeeve View Post
Hi Steffen.

Despite it sounding quite complicated, I managed to implement it.

Your description was fantastic!

Shall I create a pull request?

Shall I also create one for my dockerfile?
Thats the magic of Open Source software. With a little bit of effort, it often is really possible to modify it to ones personal preferences.

I think a pull request won't be necessary here. It would be more work for the official app release, anyway, as this change affects more puzzles, not only Solo. For the official release, I would integrate it in any game which uses this 'fully selected / pencil mark selected' mode of operation. This is something that I will do.
GerReader is offline   Reply With Quote
Old 10-18-2021, 04:01 PM   #39
Skeeve
Zealot
Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.
 
Skeeve's Avatar
 
Posts: 142
Karma: 669192
Join Date: Nov 2013
Device: Kindle 4.1.1 no touch
Fair enough. Interested in the dockerfile? Or in the CMakeList stuff I'm working on?
Skeeve is offline   Reply With Quote
Old 10-21-2021, 07:42 AM   #40
Skeeve
Zealot
Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.Skeeve ought to be getting tired of karma fortunes by now.
 
Skeeve's Avatar
 
Posts: 142
Karma: 669192
Join Date: Nov 2013
Device: Kindle 4.1.1 no touch
I change my proposal.

As you might have seen, I created a "universal" SDK Container. So no need to include a Dockerfile.

I just opened a PR for adding a CMakeLists.txt to your repo, a small extension in .gitignore to ignore the "build" directory and a new paragraph in Readme to explain how to compile using docker.
Skeeve is offline   Reply With Quote
Reply

Tags
app, programming, puzzles, sgt puzzles


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simon Tatham's portable puzzle collection? Biep Kobo Developer's Corner 2 12-27-2021 10:42 AM
Introducing Sgt. Steve Sgt Steve Introduce Yourself 2 03-14-2013 05:32 PM


All times are GMT -4. The time now is 03:08 PM.


MobileRead.com is a privately owned, operated and funded community.