Kodi Community Forum
Proposed New Skin directory layout - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+--- Thread: Proposed New Skin directory layout (/showthread.php?tid=2442)

Pages: 1 2


- jmarshall - 2004-03-28

hi all,

due to the differing resolutions that various people use, and therefore the need for displaying skins in differing resolutions, i have coded up a new system to take care of it all.

the current layout has the following structure:

<skindir>
media/
fonts/
pal/
.xml files
credits.txt

i propose to extend this by offering other subfolders for ntsc, 720p, 1080i and also pal16x9 and ntsc16x9. that will take care of all the various options.

basically the structure will change to this:

<skindir>
fonts/
pal/
pal16x9/
ntsc/
ntsc16x9/
720p/
1080i/
skin.xml

the skin.xml file will contain the current credits.txt, as well as information regarding the default resolution that xbmc should fall back on and scale if a requested resolution is not present. only one subdir actually needs to be present - the others will only be used if they are there.

the idea is that a skinner will only need to create one of the above subfolders completely - the others can be used to override the default files just like the pal/ folder currently does. xbmc then first looks in the folder corresponding to whatever resolution the gui is running in (for instance pal16x9/ ). if it doesn't find the .xml files describing the skin layout, it will fall back to the default resolution of the skin (could be pal/). once it retrieves the info, it will either display the info as is (if it found the .xml files for the correct resolution), or it will scale the .xml files to the correct resolution.

each subfolder's coordinate system depends on the resolution it represents:

pal, pal16x9: 720x576
ntsc, ntsc16x9: 720x480
720p: 1280x720
1080i: 1920x1080

this will enable skinners to get pixel perfect skins, and is also necessary due to the fact that the fonts have to be rendered based on the pixel system being used.

skinners may want to note that the pal and ntsc resolutions are not square based pixels - make sure you take the pixel aspect ratio's into account if you want nice circles etc.

the one thing i am not yet sure about is how to handle the media/ subdirectory and texture files. the current system basically searches media/ first, then the pal/media directory. this is fine, but the addition of the textures.xpr file complicates matters.

my current thoughts is that there should be just one textures.xpr file in a media/ subdir of the main skin directory. this will be generated by scanning all subdirs for there separate media/ dirs, and combining them as is currently done with the pal directory. we then attempt to load the file corresponding to the resolution we are in first, then default back to the default resolution directory if that does not work. this is pretty similar to how the pal subdir works now.

any and all comments are most welcome, from both skinners and the dev team.

cheers,
jonathan


- jmarshall - 2004-03-28

as i think about it, i see little point in having so many media subdirectories - it just makes the code + the skinning system more complex than it needs to be.

i therefore propose a single media/ directory in the skin's root directory. if the skinner wants to use different textures for different resolutions, they simply need to name them differently. the xbox scales all the images quite well, so i'd be surprised if many different versions of each image were needed anyway.

this ofcourse makes the code way simpler!

comments?


- Hullebulle - 2004-03-28

what about the ability to define a path+filename in the skin xmls instead of the filename only. this way skinners could create the folder structure and organize the files/pics like they want.


- Gamester17 - 2004-03-28

for reference, here is the previous team discussion on the topic:
Quote:subject: new skinning system to fix the resolution difficulties

after talking with some hdtv users, i propose the following system to handle
differing resolutions and skin scaling etc.

currently the default skin is in ntsc, and there is a pal subfolder that gets
used if the users xbox is in pal mode.  this seems to work quite nicely for
pal/ntsc users, so should be easily extendible for hdtv users as well.

i propose that we define the skin in the root dir of the skin's folder to be
the ntsc version.  we then scale this up to other resolutions using the
current scaling technique, though it should be changed so that it works with
ntsc dimensions instead of the pal dimensions it is currently using!!

next, we have subfolders with alternate .xml files for each other resolution.
ie.  /pal, /720p and /1080i.  the files found in here take precedence over
the default files, but anything that doesn't exist in the subfolders drops
down to the default files instead, and is then scaled as appropriate.  pretty
much how the current pal subfolder works.  any extra media files needed will
also be in these subfolders.

we should add the ability to handle different font files as well, so that hdtv
users will finally be able to read the text in xbmc on their nice big
screens.  this can all be done pretty easily.  we simply look up what
resolution the user is running xbmc in, and load the appropriate xml, media  
and font files.  i believe that the .xpr fast loading system is currently
bundling all media files (both pal and ntsc) into the single file - this may
need to be reconsidered in this new model, depending on how many different
sizes of media files we need.  i personally think that we should encourage
skinners to use just one texture file for all resolutions.  the xbox
generally scales things nice enough.

i'm happy to code this up, but thought i should get a consensus on how to
handle it, as we should get this right from the start, and not have to go
back and patch it up later.

any comments are welcome.

cheers,
jonathan
Quote:subject: re: new skinning system to fix the resolution difficulties

hi jonathan, great idea, however if that is implemented then i think the option should also be added for skinners to not only use alternate .xml files for each other resolution subfolders (ntsc, pal, 720p  & 1080i) but also alternative graphics/pictures in the subfolders for those resolutions, (many people in the forums have noted or complained that the ntsc/pal graphics are to small for hdtv or do not scale well to hdtv resolutions.

in addition remember that there is widescreen and non-widescreen for each resolution which also need to be taken in to consideration, maybe two subfolders for each resolution (one for 16:9/widescreen and one for 4:3/non-widesceen)?.

best regards / gamester17
Quote:subject: re: re: new skinning system to fix the resolution difficulties

hiya!

just to clarify one point: 720p and 1080i are by definition always
widescreen (16:9), there are no 4:3 versions of these resolutions. so one
less worry. Wink) and i agree, 720p skin support should definitely be in --
only reason i don't use it right now is because the skins are kinda messed
up regarding button placements etc.

obstler.
Quote:subject: re: re: re: new skinning system to fix the resolution difficulties

you right obstler that 720p and 1080i are by definition widescreen resolutions, but that does not change the fact that there are both 720p and 1080i non-widescreen tv's out there with 4:3 aspect ratio. to quote
jonathan: " unfortunately, due to the fact that they were introduced at a time when many tv manufacturers hadn't yet fully switched to widescreen formats, there were a generation of 4:3 televisions which came with 1080i in 4:3, with usually the option to compress the image into a 16:9 frame size (leaving bars top + bottom)".

in addition to that hdtv vga adapters like http://www.x2vga.com are non-widescreen too.

so in conclusion 4:3 (non-widescreen) for 720p and 1080i is still needed.

btw separate gui and video resolutions options/settings would be a good idea?

/ gamester17



- Gamester17 - 2004-03-28

(jmarshall @ mar. 28 2004,07:25 Wrote:the xbox scales all the images quite well, so i'd be surprised if many different versions of each image were needed anyway.
i think that the option to use different images for different resolutions should at least be given, then it's up to the skinner to use it or not


- jmarshall - 2004-03-28

i think it's easiest from a code + layout point of view just to leave every texture in the one /media directory.

skinners a more than welcome to use different textures for each resolution if they want to - they just need to name the files differently. having them in separate directories gives no real benefit imo - it just makes the code overly complicated (need to check each directory (or pseudo directory if we're reading from textures.xpr) etc. etc.)

as for having a path defined in the .xml file, that is possible, though the xbmctex application would have to take this into account as well as xbmc. once again, it would make the code more complex than it needs to be. kiss is something we should strive for imo.

any skinners have a take on this?


- Butcher - 2004-03-29

on the texture pathing - having support for subdirectories isn't a big deal for xbmc - it should basically work with the current code. by this i mean having explicitly coded subdir paths in the xml, not automatically searched subdirs. so for instance instead of <texture>background.png</texture> the skinner could use <texture>pal/background.png</texture>. this would require a modification to textures.xpr, but it should be too much of a job. i think this is something that could be useful to keep the skinners sane while dealing with the different res / aspect ratio graphics.

on the whole scaling issue - check the credits, they auto scale to the resolution being used, though i have no idea how well it works for hdtv res, only pal/ntsc.


- jmarshall - 2004-03-30

butcher: agreed that it's easy enough to add subdir support, though how do you see it layed out in terms of directory structure?

it makes sense to me to have a media/ directory in the root of the skin directory (just like fonts/ is and media/ is now).

i propose that any paths given will be taken off the media/ directory in the root of skin.

ie one would have:

skindir/
fonts/
font files etc.
media/
media files
texture.xpr
subdir1/
specific media files for hdtv or whatever
subdir2/
ntsc specific media files or whatever
skin.xml
ntsc/
pal/

etc.

ofcourse, the subdir1/ and subdir2/ etc. subdirs of the media/ directory can be called whatever the skinner likes. xbmctex will parse the media/ directory and all subdirs when generating textures.xpr.

how does that sound?

as for the scaling, i already have it coded up and it works fine. for instance, i tried using the pal specific textures in ntsc mode, and everything scaled fine once i correctly defined the height tags in the .xml files.

if the above sounds all good, i'll code up whatever else is needed, then do a cvs update sometime in the next few days.

cheers,
jonathan


- Butcher - 2004-03-30

sounds good to me, i'll modify xbmctex tonight.


- jmarshall - 2004-03-30

i've already modified the code in both xbmctex and xbmc, but am awaiting a download of the directx sdk to check my code changes are ok. i'm on 56k dialup at home, so 90mb of downloads takes a long time Smile

basically, i recurse through directories starting from inputdir (or if inputdir is null, from the current directory) and convert all the graphics files from there. file names are stored as paths offset from inputdir, in the windows path form (ie \ instead of /). i thought i might increase the file header size to 128 bytes so as to have room for 116 characters for file names as well. this seems a good compromise between unnecessary blank space, and allowing skinners a bit more latitude in naming their files.

i've just got to fix up a few coordinates in the ntsc .xml files, then all will be done.

i'll cvs commit as soon as i have it sorted tonight.

cheers,
jonathan


- Butcher - 2004-03-30

if we're going to have nexted directories, then 128 bytes may be an idea - 64 was good because i could assume the existing files were 42 chars max from being on fatx.


- jmarshall - 2004-03-31

will do 128 bytes then.


- jmarshall - 2004-04-01

have committed the changes as outlined above to the skin layout. everything should hopefully be fine, though forza has pointed out that i uploaded the incorrect version of textures.xpr. i'm on an unreliable dialup connection, so i probably can't fix this myself.

perhaps someone could please run xbmctex.exe on the media directory and commit the new file?

thanks,
jonathan


- Gamester17 - 2004-04-01

@jonathan, great work! will you make sure you update the skinning documentation too so all skinners will know how to skin now? Image


- onkel bouncy - 2004-04-01

again many changes on the skin.
to keep the overview is real hard.
i think most of the skinners stopped changing their skins.
now, me too.
possibly if there is a kind of final version of xbmc, but i guess this will be never happen.

keep xbmc alive.
Image