Opened 7 years ago

Closed 7 years 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 7 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 by Vladislav Belov, 7 years ago

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

comment:2 by Imarok, 7 years ago

Description: modified (diff)

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

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.

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

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.

in reply to:  4 comment:5 by Imarok, 7 years ago

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.

by Vladislav Belov, 7 years ago

Attachment: set_window_icon.patch added

comment:6 by Vladislav Belov, 7 years ago

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 7 years ago by Vladislav Belov (previous) (diff)

comment:7 by s0600204, 7 years ago

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.