sraboy / skaa_editor Goto Github PK
View Code? Open in Web Editor NEWSprite Editor for Seven Kingdoms: Ancient Adversaries (7KAA).
Sprite Editor for Seven Kingdoms: Ancient Adversaries (7KAA).
It's hard to identify colors in use without a color-picker/dropper tool. This is something that exists in the SkaaColorChooser (derived from ColorGrid) but hasn't been implemented yet.
A Sprite objects SpriteId is based on the filename. This should be exposed to the user and the user should be notified when game set data was not found for a sprite due to the SpriteId not being found in the database.
The problem seems to be that ObjectListView tries to call a native function, GetScrollInfo, which is provided by user32.dll. It might work if I use Wine, but I've not tried it. The FAQ for ObjectListView also states that "Mono hasn't been supported since Sep 2009."
The color remap tables used by 7KAA need to be exposed to the user so they know which colors will be remapped for different nations' colors in-game.
There's a simple one in there but it's been disabled. I'd like a tabbed one with tabs like this:
The Readme, License and Changelog should use https://github.com/ArthurHub/HTML-Renderer, which supports Markdown, so we can just use the same docs from the repo. See Cyotek's ImageBox demo app for an example of using the control with Markdown.
Most of the code is there but it's not exposed in the UI yet and various different points in the code set it to some different default. It should just remain null within ImageEditorBox until set and the main form can set a default, once the palette is loaded.
Simple right-clicking on a color in the color chooser should use that for the secondary color, which is applied with a right-click on the image.
Additionally, I'm not sure the ImageEditorBox control actually needs the ActiveSecondaryColor property. It may be easier/better for an ActiveColor property to be set based on whether a right- or left-click was detected. There is an ActiveColorChangedEventArgs class in SkaaEditorControls not being used; if not removed entirely, it should be part of the ImageEditorBox project and used by SkaaColorChooser to set an active color.
I want to be able to select a region and scale it up or down
This is currently logged as a Trace error and any file after the first returned from Directory.EnumerateFile() is ignored.
This is due to ObjectListView and the fact that a tab containing the GameSet data is set up by default. This should be done asynchronously and/or ObjectListView can be swapped for its lighter-weight version, FastListView.
I consider a bug as it can cause the application to crash if the user is impatient and starts randomly clicking the window while waiting for it to paint.
The ImageEditorBox gets Black/Transparent for default colors but these are not shown to the user, which could lead to accidental editing.
Most of the todo items mentioned in source should be issues here, either as bugs, enhancements or feature requests. Some are also out of date and probably not needed anymore.
When filling the large transparent spaces on either side of the weapon in catapult.spr, the paint bucket left the left/right edges of the image transparent, lines one pixel wide.
There are a ton of *.res files used throughout the game. The file format appears the same as, or extremely similar to, SPR files. Being able to edit these or create new ones would allow for adding new game features requiring new buttons or menu options.
Ref this thread for an example of where a new button or other control may be needed.
It's probably going to be kludgy code to maintain the backwards compatibility with 7KAA code but a user should be able to open multiple files, including those with their own data. See issues #11 and #12.
This is really only an issue when trying to save changes. The non-standard tables (not in std.set) should still be added to the ActiveGameSet but Project will need to iterate through the tables and pick out the (hardcoded) names of the standard game set and only save/return the appropriate ones (whether saving a ResIdx, dBaseIII or std.set).
This has been in progress for a while and the mini todo items are starting to stack up so I'm creating this issue to track them. The move to MVP will make it easier to update the UI and add features later but it broke a lot of previously-working functionality. Completion of these items will be spread across multiple releases/milestones but should mostly be done before the beta (0.6).
The paint bucket tool does nothing. It previously mimicked the pencil tool.
In progress...
These files have to be tested for their formats. Some way to allow the user to specify or default to ResIdxMultiBmp would be nice, probably by checking the ActiveDocument's type; if it's an ImageEditorContainer, then default to ResIdxMultiBmp. Otherwise, default to whatever other types are mapped to whatever other presenters/containers.
Opening bad files causes exceptions/crashes in alphav3. The files are assumed to be in a good format.
Nothing happens when using the menu items
SkaaEditor crashes if you try to load a new game set while already having one loaded, which is done automatically.
No changes are ever saved unless the user explicitly chooses to save the project or individual files. Temp files should be saved in AppData. Since that temp directory we create is supposed to be deleted when SkaaEditor closes, check for its existence on startup and offer a recovery option.
Some sort of basic autosaving is necessary until the codebase is a bit more robust.
It seems that edits that change the layout, such that transparent pixels are added/removed in a way that changes the byte length of the sprite frame's data, will cause 7KAA to crash:
Exception thrown at 0x00692843 in 7kaa.exe: 0xC0000005: Access violation reading location 0x0ACAD000.
If there is a handler for this exception, the program may be safely continued.
The SPR file is loaded fine during initialization but the exception is thrown while drawing in IMGbltTransRemapDecompress() (IB_TRD.cpp @ Line 75).
7kaa.exe!IMGbltTransRemapDecompress(char * imageBuf=0x7e6f0008, int pitch=800, int desX=374, int desY=430, char * bitmapBuf=0x0ac9ab60, char * colorTable=0x006e95ce) Line 99 C++
7kaa.exe!VgaBuf::put_bitmap_trans_remap_decompress(int x=374, int y=430, char * bitmapPtr=0x0ac9ab60, char * colorTable=0x006e95ce) Line 201 C++
7kaa.exe!Unit::draw() Line 124 C++
7kaa.exe!ZoomMatrix::draw_objects_now(DynArray * unitArray=0x0113b4d4, int displayLayer=1) Line 1767 C++
7kaa.exe!ZoomMatrix::draw_objects() Line 1667 C++
7kaa.exe!ZoomMatrix::draw_frame() Line 487 C++
7kaa.exe!Sys::disp_zoom() Line 1012 C++
7kaa.exe!Sys::update_view() Line 682 C++
7kaa.exe!Sys::disp_frame() Line 571 C++
7kaa.exe!Sys::process() Line 258 C++
7kaa.exe!Sys::main_loop(int isLoadedGame=1) Line 733 C++
7kaa.exe!Sys::run(int isLoadedGame=1) Line 493 C++
7kaa.exe!Battle::run_loaded() Line 634 C++
7kaa.exe!Game::single_player_menu() Line 609 C++
7kaa.exe!Game::run_main_menu_option(int optionId=1) Line 299 C++
7kaa.exe!Game::main_menu() Line 254 C++
7kaa.exe!SDL_main(int argc=1, char * * argv=0x01650008) Line 416 C++
7kaa.exe!main(int argc=1, char * * argv=0x01650008) Line 140 C
7kaa.exe!WinMain(HINSTANCE__ * hInst=0x00350000, HINSTANCE__ * hPrev=0x00000000, char * szCmdLine=0x01124c11, int sw=10) Line 177 C
7kaa.exe!__tmainCRTStartup() Line 618 C
7kaa.exe!WinMainCRTStartup() Line 466 C
kernel32.dll!74f33744() Unknown
[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]
ntdll.dll!7704a064() Unknown
ntdll.dll!7704a02f() Unknown
Notes from debugging:
data_buf=0x0AC9954D //ballista SPR
In OUNITDRW.cpp @ Unit::draw() //this.Type() = Unit
bitmapPtr=0x0ac9ab60
diff = bitmapPtr - data_buf //0x1613 = 5651
At bitmapPtr: "57 f2 f2 f8 28"
In ballista.spr_old, that's at offset 1b27
In ballista.spr (edited), it's at 1c45
File size diff = new (82864)- old (82578) = 286
This is the same diff as 1c45-1b27, confirming the change is responsible
It's not possible to resize frames in sprites. The only editable area is as defined upon loading the SPR file.
A project folder is created when a new project is created, whether or not the user is saving the file.
SkaaEditor crashes if you try to load a sprite while already having one loaded.
The snap-to-grid implementation makes ImageEditorBox's SelectionRegion inaccurate. It is, for example, impossible to start selecting somewhere in the image and drag to the bottom-right to select everything; the last lines of pixels on each of the bottom and right of the image cannot be captured.
This should be async to free up the UI. This isn't a huge issue for *.spr files but there are several very large RES files in the SPR format that take too long.
FastBitmap is recreated on every pixel draw for the pencil tool. This needs to be taken care of outside the PencilDraw() function to speed it up.
SkaaEditor crashes if you try to load a palette while already having one loaded.
This is currently logged as a Trace error and any file after the first returned from Directory.EnumerateFile() is ignored. The user should be prompted to associate each SET file with a sprite so projects can be merged.
This is only important for databases other than SFRAME, which is all we're working on so far.
The timeline control no longer animates
There is no way to add a new frame or delete a current one. This will require exposing the game set's data to the user.
Adding frames will require adding a new row to SFRAME. Removing them will require removing a row and ensuring there is either a replacement frame or the rest of the rows are adjust to ensure the frame is not referenced by 7KAA.
The user shouldn't have to save the game set and sprite separately. A project should be saved in one File>>Save operation and should be loaded in one File>>Open operation. At a minimum, the project should include an SPR file and an up-to-date SET file that will have the proper frame offsets for whatever is in the SPR.
The methods for saving a project are mixed with the UI code and are not easily testable
It flashes on screen for a split second before dying
The Timeline shouldn't use SkaaGameDataLib at all. It should have, at most, just a collection of the bitmaps. Maybe Timeline could use a framed Bitmap format and SkaaEditorUI would convert to that before setting the property.
Refactoring SkaaGameDataLib required changes in Timeline even though it's irrelevant. It's no longer well-tested.
When editing sprites, you can close the MDI tab. In the background, it is only hidden but there's no way to re-open it.
There's also no way to actually close the sprite. When a sprite is closed, its data needs to be removed from the game set (else, a user won't be able to re-open a file that has game set data because it already exists).
Temp folders, project folders, 7KAA location, working directory
Everything is currently done in the EXE's current directory.
ImageEditorBox is derived from Cyotek's ImageBox, which has a built-in selection capability. It may or may not be used... but we need to be able to select regions of an image and cut/copy/paste to other frames.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.