Commit graph

53 commits

Author SHA1 Message Date
Eduardo Dantas
d78a2546c7
feat: add Cyclopedia protobuf export pipeline (#160)
Add editor support for exporting Cyclopedia and CipSoft protobuf assets from the currently loaded map.

Main changes:
- Add File > Client Assets actions for Static House Data export, Cyclopedia minimap and satellite export, and restoring timestamped client asset backups.
- Keep generic minimap and tileset exports under File > Export.
- Export staticdata, staticmapdata, and mapdata protobuf files with content-hashed filenames.
- Update catalog-content.json so generated assets are picked up by the client.
- Merge compatible CipSoft templates when they match the loaded map.
- Fall back to generated data for custom maps instead of failing the export.
- Support filtered house exports.
- Report warnings for missing or failed static map entries.
- Emit aligned MINIMAP and sprite-based SATELLITE assets for the documented scales, including the 1/16 layer.
- Keep Cyclopedia export progress in the status bar instead of using a blocking modal progress dialog.

Performance:
- Precompute floor and chunk plans for global map exports.
- Write BMP output directly.
- Reuse minimap renders for matching satellite assets.
- Parallelize asset hash and LZMA encoding through a bounded worker queue.
- Remove modal progress overhead from the export path.
- Revert the tile-grid satellite optimization after profiling showed it shifted cost without improving total export time.

Documentation:
- Document the export contract in docs/static-data.md.
- Add docs/cyclopedia-export-roadmap.md with deferred optimization candidates and follow-up notes.

Scope:
- Focus this change on the Cyclopedia/staticdata protobuf export path and the export-specific performance work needed for practical global map exports.
- Move unrelated runtime, performance, and UI experiments out of this branch.

Validation:
- Ran static inspection and git diff checks during the export changes.
- Reviewed Visual Studio CPU profiles after each global map export performance pass.
- Verified hash and LZMA work moved into bounded async workers.
- Verified the restore action is labeled as restore and grouped under File > Client Assets, not File > Export.

This adds the editor-side pipeline needed to generate client Cyclopedia assets from a loaded map while keeping the export flow recoverable, documented, and practical for large maps.
2026-05-28 08:35:21 -03:00
Victor
d57615d212
feat: implement sprite atlas rendering using sheet textures (#171)
New Features:
- Per-sprite UV and blit options for precise partial/atlas-based sprite rendering, including improved editor sprite blits.

Graphics & Performance:
- Lazy atlas texture upload with atlas-managed lifecycle to reduce memory/GPU churn.
- Rate-limited automatic cleanup of unused textures.

Behavior Changes:
- More accurate texture mapping: sprites, outfits and indicators now render using per-sprite atlas coordinates.
2026-04-22 19:19:35 -03:00
Victor
9f418ed06d
feat: add Bitmap to Map terrain generator (#166)
New Features:
- Import Bitmap to Map: new menu entry to launch the conversion workflow.
- Conversion dialog: image preview with zoom, crop, rotate, flip, scale and X/Y/Z offsets; mouse pixel inspection.
- Color detection: auto-detect colors, suggest brushes, per-color ignore/brush selection, adjust tolerance, RGB or hue matching.
- Presets: save/load conversion settings.
- Generate: preview generation, progress feedback, conversion to map tiles with success/error reporting.
2026-04-21 11:55:08 -03:00
Victor
4f495b8e19
feat: OpenGL modern migration (#165)
New Features:
- Added a modern OpenGL renderer with batched 2D drawing, textured bitmap text, stippled lines, polygons and a baked font atlas.

Refactor:
- App-wide rendering switched to the new renderer.
- Map and lighting now draw via renderer primitives and sprite lookups use stable sprite IDs.

Bug Fixes:
- Improved texture allocation/invalidation/cleanup and sprite bounds safety.
- Restored/normalized keyboard shortcut behavior (Q/B remap, SHOW_NPCS → Shift+N, Linux shortcut dispatch).

Chores:
- Replaced legacy GLUT with a GL loader and integrated stb.
- Updated build configuration and project files.
2026-04-17 18:58:28 -03:00
Victor
2f5cf89792
fix: correct start_frame type mismatch from protobuf loading (#163)
## What was changed  
  
Fixes an assertion failure in the `Animator` constructor caused by
`start_frame`
receiving the value `255` (uint32) from protobuf `default_start_phase`,
instead of
`-1` (int8) as expected.  
  
## Why  
  
The `.dat` loading path reads `start_frame` as `int8_t`, so the byte
`255` becomes
`-1`, which is a valid sentinel value for the `Animator`. However, the
protobuf
loading path stores `default_start_phase` as `uint32_t`,   
preserving the value `255`, which fails the assertion   
`ASSERT(start_frame >= -1 && start_frame < frame_count)`.  
  
## Changes  
  
- `source/items.h`: Changed `start_frame` type from `uint32_t` to
`int32_t`
- `source/items.cpp`: Added `static_cast<int8_t>` when reading
`default_start_phase` from protobuf
- `source/graphics.cpp`: Added `static_cast<int8_t>` in
`loadOutfitSpriteMetadata` and `static_cast<int>` in
`loadItemSpriteMetadata` when creating `Animator`

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Fixed animation frame value handling for items and sprite metadata to
ensure consistent initialization and proper animation playback
sequences.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-04-14 13:39:40 -03:00
Victor
253cf397f4
fix: outfit color cache and addon rendering for creatures (#164) 2026-03-29 02:02:08 -03:00
Eduardo Dantas
6d501a5ad2
feat: support reading assets from client 11 or higher (#70)
feat: migrate Remeres to 12.x assets system and modernized item handling

• Migrated old Remeres .dat/.spr system to new 12.x client /assets/ appearance & sprite format
• Removed OTB dependency and outdated client version structures
• Integrated Protobuf-based sprite reader (credit: @nekiro)
• Major refactor on graphics.cpp structure and brush icon handling
• Updated brushes and tags system
• Fixed top order drawing bugs and missing brushes icons
• Fixed outfit color paint and correct offset handling for non-32x32 sprites
• Re-enabled map saving and loading
• Improved creature sprite rendering and brush previews
• Added new item properties window with toggle for legacy/new layout

Co-authored-by: Marcos <66353315+marcosvf132@users.noreply.github.com>
Co-authored-by: Pedro Henrique Alves Cruz <phac@cin.ufpe.br>
2025-05-10 16:38:45 -03:00
Pedro Cruz
6ef5ba1fa6
feat: show item and ground avoidables (block pathfinder) (#103)
Feature that enables to check an option to show in the map an icon of avoidable items and grounds (block pathfinder).
2024-08-14 16:54:14 -03:00
Majesty
b1c0df557f
feat: monsters and npcs spawns icons (#58) 2023-10-27 15:52:05 -03:00
Luan Santos
2ee365e836
ci: add clang-format linter (#54) 2023-10-09 19:12:16 -07:00
Beats
6b55201a64
feat: synchronizing commits with the official rme repository (#36)
* Show indicators for pickupable and moveable items

* Fix: drawing always refreshing ui

* Fix crash on invalid friend for wallbrush

* Option to remove empty spawns

* Draws position indicator, some code cleanup

* Teleport copy/paste improvements

* Fix flood fill

* Add function to get minimap/8bit color

* Small code cleanup

* Cleanup Position

* Code cleanup and small optimizations

* Code cleanup

* Code cleanup and small optimizations (#406)

* Cleanup and cast functions.

* Avoid adding a new Unique ID if it already exists

* Code cleanup and small optimizations

* More changes and cleanup

* Changes and cleanup

* Some changes

* Fix copy position.

* Only show uid/aid alert if it really changed

* Add actions history panel

* Does not draw tooltips on minimap mode

* Use constexpr

* Replace items fix (#408)

* Draw grid small optimization

* Small change in selection box and Fix #409

* Fix some xpm

* Ingame box improvements, add lights support.

* Fix go to previous position (#410)

* Fix depot crash (#411)

* Fix XPMs

* Export minimap as .otmm (otclient format) or .png (#413)

* Fix glitch after drawing secondary map

* fix

* Update about_window.cpp

* sonar

* fix Minimap and progress bar

* fix erro load items.xml

* fix

* fix doodad brush

* fix: slightly more accurate house size estimation

* feat: update items.otb and items.xml

* fix: bad merge

* Revert "feat: update items.otb and items.xml"

This reverts commit 40f1edc70f.

---------

Co-authored-by: Nailson <Mignari@users.noreply.github.com>
Co-authored-by: wtver <51377408+maattch@users.noreply.github.com>
Co-authored-by: Majesty <32709570+majestyotbr@users.noreply.github.com>
Co-authored-by: Luan Santos <github@luan.sh>
2023-10-09 19:02:37 -07:00
Beats
17e42a5056
feat: improve cmake build and add pugixml integration (#40) 2023-09-08 03:04:02 -03:00
Eduardo Dantas
047113ade3 Merge branch 'master' 2022-08-19 02:43:27 -03:00
Danilo Pucci
579f1f47f7
fix GraphicManager::loadSpriteMetadata from trying to load invalid .dat (#384) 2022-03-03 18:41:11 -03:00
Eduardo Dantas
adef6c47c1
Change ids to clientid and organize data folder and tilesets (#6)
This only works with the canary server: https://github.com/opentibiabr/canary

Added support only for client .dat and .spr 11.00 outdated (10x), signature: data format="11" dat="0x4A10" spr="0x59E48E02"

Otb cllient 11, version 3, id 62

In addition to the ids being converted to client id (for compatibility with canary), the data folder has been completely reorganized for ease of understanding.
The organization of tilesets was also started, which will be further improved in other pulls.
2021-06-23 21:30:37 -03:00
yamaken93
6022bf797e
feat: draw creature addons and mounts (#357)
support creature outfit mounts with the lookmount xml attribute
2021-06-06 20:05:01 -03:00
Eduardo Dantas
e09f3e94c8
Decouple npcs from the creature class (it's create npc.xml file in the map folder) (#3)
Created the complete organization of npcs, that way, it is possible to create own files for npcs, no longer depending on being together with the monsters
this pull request was made to be worked together with the canary project: https://github.com/opentibiabr/canary

The spawns npcs is "yellow" and spawns monsters is "red" (the old)

With this change, the map will automatically create an "npc.xml" the first time it is saved.
It is possible to edit only the xml, it is not necessary to add or modify the npc by opening the editor map

Thus, there is a script for npcs, similar to how it works with old spawns
2021-05-25 00:29:12 -03:00
Evil Puncker
cfe36ce5b3
license headers (#315) 2020-07-30 11:42:28 -03:00
Nailson
4bfd7347a7
Load assets name from otfi file. (#276) 2019-07-23 10:21:07 -03:00
Mignari
272c0a987f Define const for assets files. 2018-10-14 19:54:08 -03:00
Mignari
dcab8f1c08 Fix empty brushes. 2017-10-08 21:17:26 -03:00
Hampus Joakim Nilsson
b90db91a9e Fixed #205. Now reads ICON_BACKGROUND from settings again. 2017-07-04 20:07:29 +02:00
Nailson
63aebafe54 New Find/Jump to Item Dialog, some code cleanup. 2017-05-19 15:19:10 -03:00
Nailson
f84b560342 Fix view fails when using transparency, sync animation. Closes #189 2017-05-06 12:31:26 -03:00
Nailson
faec29c100 Fix stretched sprites. Closes #174 2017-03-26 16:50:51 -03:00
Nailson
95848c10f5 Using consts. 2016-11-12 10:56:02 -03:00
Nailson
c03e041b38 Fix black sprite, code cleanup. 2016-11-09 13:06:59 -03:00
Nailson
cbd3ae3de9 Add animations preview. Closes #143
Keyboard shortcut L
2016-11-09 12:17:17 -03:00
Nailson
12cee8b5cd Fix items larger than 64x64 shows a red background. Closes #148 2016-11-09 11:49:58 -03:00
Elime1
610aeeaeaa Remove use of wxT macro. Closes #141 2016-11-05 15:28:14 +01:00
Nailson
d6d7643176 Rename global variable 'settings' to 'g_settings'. 2016-09-29 20:37:43 -03:00
Nailson
6ab0f851a4 Rename global variable 'gui' to 'g_gui'. 2016-09-29 20:30:54 -03:00
Nailson
23a8fb15a1 Trim trailing whitespaces. 2016-09-29 19:24:45 -03:00
Cristofer Martins
c323157e9d support for 10.92,10.93 and 10.94 on the sources 2016-06-10 14:40:02 -03:00
Nailson
d7a4254604 Code style and some cleanup. 2015-12-06 11:42:37 -03:00
Nailson
4108f39a12 Implements OTFI.
OTFI is an OTML file with information about the features enabled in the
dat/spr.
This commit removes the extended and transparency options in
preferences. Please use an otfi file along with the dat / spr to inform
the required features.
It's not necessary to regular files.
2015-02-17 10:41:13 -03:00
Nailson
5038327c7c Oops, the dat format was changed in version 10.57 2015-02-07 07:33:03 -03:00
Nailson
39e8635450 A single method to load metadata flags.
This works like in the OTClient.
2015-02-06 10:30:02 -03:00
Nailson
9241f6bcfb Changed the loading of data format.
Now uses the 'format' tag to indicate which format the editor should
use.
2015-02-05 21:07:44 -03:00
Nailson
80763299fb Changed variable names for clarity. 2015-02-03 22:59:14 -03:00
Nailson
528e0b6765 Indentation fix and small optimization. 2015-02-01 14:07:12 -03:00
Nailson
445885e2a1 Support for versions 10.50+ (data sources not included)
Allows support for versions 10.50+

Use the 'datversion=10.50' to versions 10.50 - 10.55
Use the 'datversion =10.56' to versions 10.56 or greater
2015-02-01 13:42:24 -03:00
Nailson
eff7b6f8e4 Support for extended and transparent spr. 2015-01-23 10:30:09 -03:00
dalkon
be14fa5ff0 Skip mipmaps until it can be done properly 2014-03-09 16:56:00 +01:00
dalkon
6b30c629be Code cleanup
Also fixed the small mistake I did last time.
2014-03-09 16:53:29 +01:00
dalkon
c74b6dbeae Bug fix and misc
GUI::SetLoadDone was taking way too long to update and made any map load
very slowly.
Changed any "uint" to "uint32_t"
Fixed a bunch of warnings.
2014-02-28 22:34:25 +01:00
dalkon
4a729176c4 Fixes and changes.
Rewrote RME Live to use boost asio instead of wxSocket, this seemed to
fix random stops when using the function, some other things were fixed
aswell when using this.
Added 10.10 & 10.21+ (I have not added the otbs and such yet.)
Bug fix and some small cleanups.
2014-02-21 13:55:09 +01:00
dalkon
886cbc23a7 Lots of changes
Removed libxml2 to use pugixml.
Fixed a bug with the progress bar.
Changed some things in most xml files that pugixml did not like.
Updated the Visual Studio project.
Any NULL symbol has been changed to nullptr.
This most probably broke the CMake that was recently added.
And probably some other things.
2014-01-22 20:16:17 +01:00
Hampus Joakim Nilsson
2025476e49 Fixed .dat loading bug. 2012-07-01 16:49:44 +02:00
Hampus Joakim Nilsson
70adf0c90d .spr loading is now data-dependant as well. 2012-07-01 16:35:50 +02:00