{"id":48,"date":"2009-06-08T18:34:01","date_gmt":"2009-06-08T18:34:01","guid":{"rendered":"https:\/\/blogs.scummvm.org\/upthorn\/?p=48"},"modified":"2022-05-25T18:35:02","modified_gmt":"2022-05-25T18:35:02","slug":"the-barest-of-skeletons","status":"publish","type":"post","link":"https:\/\/blogs.scummvm.org\/upthorn\/2009\/06\/08\/the-barest-of-skeletons\/","title":{"rendered":"The barest of skeletons"},"content":{"rendered":"<div class=\"storycontent\">\n<p>While no consensus has yet been reached on the concerns regarding the API, I am going ahead and starting work one of the possibilites that has begun to feel fully formed in my head:<\/p>\n<p>This model uses an enum type, (temporarily Graphics::ColorFormat) which is divided into two parts, FormatType and ColorOrder, which are ORed together.<\/p>\n<p>To start with, I am providing ten values for FormatType:<\/p>\n<ul>\n<li>kFormat8Bit = 0<\/li>\n<li>kFormatRGB555 = 1<\/li>\n<li>kFormatARGB1555 = 2<\/li>\n<li>kFormatRGB556 = 3<\/li>\n<li>kFormatRGB565 = 4<\/li>\n<li>kFormatRGB655 = 5<\/li>\n<li>kFormatARGB4444 = 6<\/li>\n<li>kFormatRGB888 = 7<\/li>\n<li>kFormatARGB6666 = 8<\/li>\n<li>kFormatARGB8888 = 9<\/li>\n<\/ul>\n<p>and 31 values for ColorOrder<\/p>\n<ul>\n<li>kFormatPalette = 0 &lt;&lt; 8<\/li>\n<li>kFormatRGB = 1 &lt;&lt; 8<\/li>\n<li>kFormatRBG = 2 &lt;&lt; 8<\/li>\n<li>kFormatGRB = 3 &lt;&lt; 8<\/li>\n<li>kFormatGBR = 4 &lt;&lt; 8<\/li>\n<li>kFormatBRG = 5 &lt;&lt; 8<\/li>\n<li>kFormatBGR = 6 &lt;&lt; 8<\/li>\n<li>kFormatARGB = 7 &lt;&lt; 8<\/li>\n<li>\u2026<\/li>\n<li>kFormatBGRA = 30 &lt;&lt; 8<\/li>\n<\/ul>\n<p>For this tentative model,\u00a0 the optional parameter to Engine::InitGraphics will be a Common::List of formats the game supports. The backend will iterate through this list and test each entry for compatibility, using a pair of switches, as per the following simplified example:<\/p>\n<pre>OSystem::TransactionError checkFormatCompatibility(Graphics::ColorFormat format)\r\n{\r\nswitch(format &amp; kFormatTypeMask) {\r\ncase kFormat8Bit:\r\ncase kFormatRGB555:\r\nbreak;\r\ndefault:\r\nreturn kTransactionPixelFormatNotSupported;\r\n}\r\n\r\nswitch (format &amp; kFormatOrderMask) {\r\ncase kFormatRGB:\r\ncase kFormatARGB:\r\nreturn kTransactionSuccess;\r\ndefault:\r\nreturn kTransactionPixelFormatNotSupported;\r\n}\r\n}<\/pre>\n<p>NOTE FOR DEVELOPERS: I do <strong>not<\/strong> really expect this to be an acceptable final implementation, as it is a combination of overkill (who\u2019s ever heard of BAGR6666 color?) and underkill (no YUV support), so, pending further notice <strong>do not use<\/strong> information from this post to make any plans or modifications to your engine or your backend. I am only using this as a direction for me to pursue while I await a final decision from full developers.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>While no consensus has yet been reached on the concerns regarding the API, I am going ahead and starting work one of the possibilites that has begun to feel fully formed in my head: This model uses an enum type, (temporarily Graphics::ColorFormat) which is divided into two parts, FormatType and ColorOrder, which are ORed together. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-48","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.scummvm.org\/upthorn\/wp-json\/wp\/v2\/posts\/48","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.scummvm.org\/upthorn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.scummvm.org\/upthorn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/upthorn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/upthorn\/wp-json\/wp\/v2\/comments?post=48"}],"version-history":[{"count":2,"href":"https:\/\/blogs.scummvm.org\/upthorn\/wp-json\/wp\/v2\/posts\/48\/revisions"}],"predecessor-version":[{"id":50,"href":"https:\/\/blogs.scummvm.org\/upthorn\/wp-json\/wp\/v2\/posts\/48\/revisions\/50"}],"wp:attachment":[{"href":"https:\/\/blogs.scummvm.org\/upthorn\/wp-json\/wp\/v2\/media?parent=48"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/upthorn\/wp-json\/wp\/v2\/categories?post=48"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/upthorn\/wp-json\/wp\/v2\/tags?post=48"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}