Marmalade corrupts textures when deployed to Android - marmalade

I'm currently writing an application for Android using Marmalade. I must say that I find the .mkb syntax highly annoying, regardless of that, Marmalade seems to be corrupting my textures, but only when I add the files to my .mkb file.
With the following MKB file, my output is this
#!/usr/bin/env mkb
files
{
[Source]
(Source)
MobileMario.cpp
Game.h
Game.cpp
Renderer.h
Renderer.cpp
Scene.h
Scene.cpp
Scene_Menu.h
Scene_Menu.cpp
Scene_Level.h
Scene_Level.cpp
GUI.h
GUI.cpp
}
subprojects
{
iwutil
iw2dscenegraphcore
iw2dscenegraph
iwgx
iwresmanager
iwtween
}
assets {
(data)
mario.tga
mario.gxfont
(data/Textures)
mario.png
mario_logo.png
options_background.png
(data/Tilemaps)
1_1_test.png
}
deployment
{
}
When I leave out the "assets" section of my .mkb file, the output is this. The output it SHOULD have, is this, as you can see, the fonts don't render on mobile, which probably means I need to add the files to my .mkb file, but doing so (or even adding one file), it corrupts everything.

I changed the way Marmalade's "assets" section looks and everything seems to be working. Still don't know why it corrupted before, at least I don't have the problem anymore.

Related

How can I manually edit the list of recently opened files in VS Code?

I rely heavily on the File: Open Recent… command to open frequently used files, but yesterday my local Google Drive folder got moved to a new location and now I can no longer access any of the files in that folder through the Open Recent panel because the paths don't match.
The fix would be as simple as replacing "/Google Drive/" with "/Google Drive/My Drive/" but I have no idea what file contains the list of files that appears in the recently opened panel.
I'm assuming it's somewhere in ~/Library/Application Support/Code but not sure where.
I was wondering the same thing the other day and found this while searching for a solution, so I took some time to investigate it today.
It's been a a few weeks since you posted, so hopefully this will still be of help to you.
Also, I'm using Windows and I'm not familiar with macOS, but I think it should be easy enough adjust the solution.
Location of settings
Those setting are stored in the following file: %APPDATA%\Code\User\globalStorage\state.vscdb.
The file is an sqlite3 database, which is used as a key-value store.
It has a single table named ItemTable and the relevant key is history.recentlyOpenedPathsList.
The value has the following structure:
{
"entries": [
{
"folderUri": "/path/to/folder",
"label": "...",
"remoteAuthority": "..."
}
]
}
To view the current list, you can run the following command:
sqlite3.exe -readonly "%APPDATA%\Code\User\globalStorage\state.vscdb" "SELECT [value] FROM ItemTable WHERE [key] = 'history.recentlyOpenedPathsList'" | jq ".entries[].label"
Modifying the settings
Specifically, I was interested in changing the way it's displayed (the label), so I'll detail how I did that, but it should be just as easy to update the path.
Here's the Python code I used to make those edits:
import json, sqlite3
# open the db, get the value and parse it
db = sqlite3.connect('C:/Users/<username>/AppData/Roaming/Code/User/globalStorage/state.vscdb')
history_raw = db.execute("SELECT [value] FROM ItemTable WHERE [key] = 'history.recentlyOpenedPathsList'").fetchone()[0]
history = json.loads(history_raw)
# make the changes you'd like
# ...
# stringify and update
history_raw = json.dumps(history)
db.execute(f"UPDATE ItemTable SET [value] = '{history_raw}' WHERE key = 'history.recentlyOpenedPathsList'")
db.commit()
db.close()
Code references
For reference (mostly for my future self), here are the relevant source code areas.
The settings are read here.
The File->Open Recent uses those values as-is (see here).
However when using the Get Started page, the Recents area is populated here. In the Get Started, the label is presented in a slightly different way:
vscode snapshot
The folder name is the link, and the parent folder is the the text beside it.
This is done by the splitName method.
Notes
Before messing around with the settings file, it would be wise to back it up.
I'm not sure how vscode handles and caches the settings, so I think it's best to close all vscode instances before making any changes.
I haven't played around with it too much, so not sure how characters that need to be json-encoded or html-encoded will play out.
Keep in mind that there might be some state saved by other extensions, so if anything weird happens, blame it on that.
For reference, I'm using vscode 1.74.2.
Links
SQLite command-line tools
jq - command-line JSON processor

Why does DITA Open Toolkit PDF plugin rename image href attributes?

I'm sorry if this doesn't have enough information. I don't typically ask for help online like this.
I'm using DITA Open Toolkit 3.4 on Windows. I generated a plugin called "vcr2" using Jarno's (very excellent and helpful) PDF Plugin Generator and then made a handful of customizations. The plugin uses the pdf2 plugin as a base. When I try to use the vcr2 plugin, my images are not working. I've tracked the problem down to malformed image filenames in the image's href attribute.
For example:
In my source file (a DITA Task), the markup for one of my images looks like this:
<image href="MyRemindersChooseReminder.png"/>
If I run a transform with the pdf2 plugin, the images work fine. In the merged stage1.xml file in the Temp folder, the XML for that same image looks like this:
<image class="- topic/image " href="df2d132af27436c59c5c8c4282e112d62bec8201.png" placement="inline" xtrc="image:1;10:66" xtrf="file:/V:/Vasont/Extract/t12340879-minimal/t12340879.xml"/>
It is processed into a file Topic.fo, and looks like this:
<fo:external-graphic
 src="url('file:/V:/Vasont/Extract/t12340879-minimal/MyRemindersChooseReminder.png')"/>
Everything works fine and the image looks fine.
If I run the same file through my 'vcr2' plugin, which just calls the same pdf2 plugin with some overrides, all the images get broken:
stage1.xml
<image class="- topic/image " href="df2d132af27436c59c5c8c4282e112d62bec8201.png" placement="inline" xtrc="image:1;10:66" xtrf="file:/V:/Vasont/Extract/t12340879-minimal/t12340879.xml"/>
Topic.fo
<fo:external-graphic
 src="url('file:/V:/Vasont/Extract/t12340879-minimal/df2d132af27436c59c5c8c4282e112d62bec8201.png')"
/>
As I track this down further, it appears that somewhere in the map-reader Ant task, this filename gets changed to that cryptic string of pseudo-hexadecimal. I think later on it's supposed to be changed back or resolved to a complete URI or something.
So, the two-part question is: Why does Open Toolkit change my filenames, and what's supposed to change them back?
DITA-OT's preprocess uses hashes for temporary filenames because it allows the code to not deal with directory structures. This enables preprocess to work in so-called "map-first" mode, where it first processes all DITA map resources and only then starts to process DITA topic and image resources.
The preprocess has a step called clean-preprocess that can rewrite the temporary file names to match source resource files names. However, this rewrite operation is disabled for PDF output because the original file names are not used for anything in that output type.

Exclude specific directories from being parsed by intellisense

I am using php-intellisense extension for my Visual Studio Code.
How do I exclude other folders from being parsed by this extension? As of now it only excludes node_modules and vendor folder.
The extension does not seem to have any specific setting so, unless I'm missing something, the only way to accomplish that is the files.exclude directive. It should definitively work with all languages because it basically makes the file or directory totally disappear from the program.
Beware though of the consequences: you won't even see the folder in the file explorer, nor will it show in searches.
There is an opened issue on the author's github. I've just added a comment to explain how to workaround it.
Please have a look to my comment: https://github.com/felixfbecker/php-language-server/issues/159#issuecomment-514581602
In brief, you can change the way the workspace files are scanned in this file :
C:\Users\USER\ .vscode\extensions\felixfbecker.php-intellisense-xxxx\vendor\felixfbecker\language-server\src\ Indexer.php
public function index(): Promise
{
return coroutine(function () {
// Old code using the rootPath
//$pattern = Path::makeAbsolute('**/*.php', $this->rootPath);
// My new pattern
$pattern = Path::makeAbsolute('**/*.php', 'C:/Users/[USER]/Projects/sources/app/code');
$uris = yield $this->filesFinder->find($pattern);
// ...
});
}
Restart VS Code after saving the changes and it will only index the needed path.

How to resolve Unable to find file.cpp in path(s) in Marmalade?

I'm just trying to begin develop a game in Marmalade (6.3). But when I have made my new sources (.cpp, and .h) and added them to the mkb, and then trying to run my program, then I got an error which says that Unable to find file.cpp in path(s). It's for all of my files except the files (game.h, game.cpp, main.cpp) which were made by Marmalade when I have chosen the new 2D game project. Should I add my .cpp and .h files to anywhere else?
Thanks
It is difficult to give a categorical answer without more info. However my guess is that you've copied and pasted from an example and not understood about the syntax of the files section. Basically:
files
{
(foo)
humbug.cpp
)
The "(foo)" might look very innocent, but it actually says that humbug.cpp is actually in directory foo - relative to the mkb file. It is common practice to actually use "(source)" and put all the source files in a directory of that name - making the source layout a bit neater.
Naturally if you have (source) and don't put the files actually in directory source, they won't be found. My guess is that is what you are seeing.
Just to clarify previous answer, The format of files directive is like this -
files
{
(<Path relative to MKB>,<Alternate Path>)
["Name of the parent Group in VS/XCode project","Name of the subparent group"]
fileName.cpp
fileName.h
}
for example I have two files SoundManager.h and SoundManager.cpp in System folder of Source, while MainMenu.h and MainMenu.cpp in Source/UI. Now the files directive would be -
files
{
(Source/System)
["Source","System"] #This part is not required, it's just to arrange your files in IDE project
SoundManager.h
SoundManager.cpp
(Source/UI)
("Source","UI")
MainMenu.h
ManinMenu.cpp
}

Photoshop plugin Pipl resources and disabling save

I have a photoshop plugin for a file format Ive written in c++ that loads and opens the images, however I do not have code to save the image in the same format
Using SimpleFormat sample plugin as a base I have the following code:
FormatFlags { fmtSavesImageResources,
fmtCanRead,
fmtCanWrite,
fmtCanWriteIfRead,
fmtCanWriteTransparency,
fmtCanCreateThumbnail },
However removing fmtCanWrite or IfRead etc produces parser errors in the Pipl tool, I've checked the syntax and it should be correct but I cannot figure out how to do this =s
This is really counter-intuitive but if you check out pg 77 of Plug-in Resource Guide.pdf from the SDK the flags aren't really flags, they are actually keywords. Based on the grammar they give, to not include the write flag you actually need to replace it with a do-not-write flag.
For example, this compiles fine for me:
FormatFlags { fmtDoesNotSavesImageResources,
fmtCanRead,
fmtCannotWrite,
fmtCanWriteIfRead,
fmtCanWriteTransparency,
fmtCanCreateThumbnail }