Opened 3 years ago

Closed 22 months ago

#4363 closed enhancement (fixed)

The main game has no window icon

Reported by: Imarok Owned by:
Priority: Nice to Have Milestone: Alpha 23
Component: Core engine Keywords:
Cc: Patch: D768

Description (last modified by s0600204)

0ad itself has an application icon, but no window icon (the one you can see when switching between windows and that is displayed in the top left corner of the window on microsoft windows ) Atlas (scenario editor) has a window icon (the globe: http://trac.wildfiregames.com/export/18995/ps/trunk/binaries/data/tools/atlas/icons/ScenarioEditor.ico), which is set here. This maybe could be accomplished with SDL_SetWindowIcon()

The missing window icon is confirmed for windows and ubuntu gnome

Attachments (1)

set_window_icon.patch (1.5 KB) - added by Vladislav Belov 3 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 3 years ago by Vladislav Belov

It should be solved with resource files (*.rc) if I'm not mistaken, if it's the only windows issue.

comment:2 Changed 3 years ago by Imarok

Description: modified (diff)

comment:3 in reply to:  description ; Changed 3 years ago by Imarok

I tested SDL_SetWindowIcon() with a hardcoded icon and it works perfectly on windows and linux. The difficult part is loading the 0ad icon from a file and transform it into a SDL_Surface. For reference: That is also done for cursors here.

comment:4 in reply to:  3 ; Changed 3 years ago by Vladislav Belov

Replying to Imarok:

I tested SDL_SetWindowIcon() with a hardcoded icon and it works perfectly on windows and linux. The difficult part is loading the 0ad icon from a file and transform it into a SDL_Surface. For reference: That is also done for cursors here.

Solution on the link above should work for icons too.

comment:5 in reply to:  4 Changed 3 years ago by Imarok

Replying to vladislavbelov:

Replying to Imarok:

I tested SDL_SetWindowIcon() with a hardcoded icon and it works perfectly on windows and linux. The difficult part is loading the 0ad icon from a file and transform it into a SDL_Surface. For reference: That is also done for cursors here.

Solution on the link above should work for icons too.

Not with the format we have the 0ad icon in. I managed to get it working, but it looked very ugly. So the main issue is finding the right format/size and the right way to import it.

Changed 3 years ago by Vladislav Belov

Attachment: set_window_icon.patch added

comment:6 Changed 3 years ago by Vladislav Belov

The code above works on windows, IMO, there should be sys-dependencies, because different OSs and WMs have different icon constraints: windows: 64x64 (old: up to 32x32), linux: 256x256 (avg, sometimes 1024x1024), os x: 512x512 (AFAIC). And an autoresizing will make the icon worse, than artists (from another side, we could use few basics resolutions: 64x64, 256x256, 1024x1024 to resize to the nearest).

Last edited 3 years ago by Vladislav Belov (previous) (diff)

comment:7 Changed 22 months ago by s0600204

Description: modified (diff)
Keywords: simple removed
Milestone: BacklogAlpha 23
Patch: D768
Resolution: fixed
Status: newclosed
Type: defectenhancement

Committed in r20067 (Phab:rP20067)

Note: See TracTickets for help on using tickets.