Commit Graph

87 Commits

Author SHA1 Message Date
salix5 50b693f713 Use size_t for index and return uint32_t in CheckDeck (#3051) 2026-04-15 12:55:43 +08:00
Mercury233 674564c826 rename dataManager.FileSystem to IrrFileSystem (#3042) 2026-04-04 20:26:52 +08:00
salix5 78c1a9b390 Remove unnecessary header files from config.h (#3036) 2026-03-29 22:44:32 +08:00
salix5 6fea874dac Change Deck to (const CardDataC*) vector (#3006) 2026-03-25 09:34:16 +08:00
salix5 bd326e20d9 Add datas.rule_code (#3000) 2026-03-15 18:21:01 +08:00
Mercury233 90198376d8 remove _IRR_WCHAR_FILESYSTEM and make DataManager::LoadDB accept char* (#2977) 2026-03-10 06:49:13 +08:00
mercury233 88ba8c9cdc remove memset 0 for deckBuffer in DeckManager::LoadCurrentDeck
inited by {} already
2026-02-27 16:30:28 +08:00
Mercury233 bbd99ad4d1 use _IRR_WCHAR_FILESYSTEM instead of _WIN32 in related #ifdef (#2976) 2026-02-22 17:10:14 +08:00
salix5 fea2a56265 Check empty file path in LoadCurrentDeck 2025-09-02 16:53:02 +08:00
salix5 961517bb1a Remove static deckBuffer 2025-09-02 16:53:02 +08:00
salix5 00d46b2caf use deck category constant
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-31 21:29:05 +08:00
salix5 23bb85c6bf Refactor LoadCurrentDeck 2025-08-31 21:29:05 +08:00
salix5 2e74d40d14 Add deck category constants 2025-08-31 21:29:05 +08:00
salix5 d921cd0fc0 DataManager: change unknown_string, FileSystem to instance member (#2907) 2025-08-23 14:53:58 +08:00
salix5 17715fe485 add GetDataTable, GetStringTable (#2905)
* add GetDataTable, GetStringTable

* Refactor table access in ClientField and DeckBuilder

* Refactor LoadDeck to use table lookup

* Refactor loops in DeckBuilder::check_limit
2025-08-22 13:55:06 +08:00
salix5 71b960125f use fputs in SaveDeck (#2902) 2025-08-11 23:45:15 +08:00
salix5 3b885f2fc0 Improve error handling in LoadDeckFromStream, LoadLFListSingle (#2871) 2025-07-05 00:13:38 +08:00
Mercury233 b9e1089f8e add import/export deck code (#2577) 2025-06-18 14:58:05 +08:00
salix5 471c2134a3 Read player names, deck & check script path on OpenReplay (#2776) 2025-05-17 08:53:06 +08:00
salix5 50d5877f9f fix DeckManager::SaveDeck (#2775) 2025-05-04 16:43:10 +08:00
Mercury233 9350f5d693 add myfopen, fix setlocale (#2713) 2025-04-21 10:08:00 +08:00
Mercury233 ccf3398d15 add FileSystem::RemoveFile (#2760) 2025-04-21 10:06:27 +08:00
salix5 fd189e5c8c DeckManager: use uint32_t code (#2739)
* fix LoadLFListSingle

* update LoadDeck, LoadSide

* rename to LoadDeckFromStream

* update CTOS_DeckData

* static member function
2025-03-29 10:44:21 +08:00
salix5 56f5fd4ba9 use unsigned hash in CheckDeck (#2736) 2025-03-19 09:55:35 +08:00
salix5 b2a50ac0a9 fix namespace irr::io 2025-03-14 19:10:07 +08:00
salix5 6c53d02a2b use <cstdlib> functions (#2720)
* replace exit

* replace malloc, calloc

* replace strtol

* #include <cstdlib>
2025-03-13 17:26:44 +08:00
salix5 d06a9096fd rename: GetLFListContent -> GetLFList (#2715)
* update DeckManager::GetLFListContent

* change DeckBuilder::filterList into const LFList*

* update Game::DrawThumb

* rename: GetLFListContent -> GetLFList

* update the signature of DeckManager::GetLFListName

* change code to unsigned
2025-03-08 15:22:53 +08:00
salix5 118f951bc1 set errno before strtol (#2705) 2025-02-28 22:17:34 +08:00
salix5 9d4496f79c DeckManager: fix LoadLFListSingle, LoadDeck (std::istringstream) (#2699)
* fix DeckManager::LoadLFListSingle

* fix DeckManager::LoadDeck (std::istringstream)

* typos

* fix conversion

* workaround
2025-02-28 17:52:34 +08:00
salix5 6d6213ae7f fix DeckManager::LoadDeck(Deck& deck, (#2697)
* use default constructor

* fix DeckManager::LoadDeck(Deck& deck,
2025-02-23 11:07:58 +08:00
salix5 148c76806e DeckManager: update GetDeckFile LoadCurrentDeck (#2694)
* update DeckManager::GetDeckFile

* update reference

* update DeckManager::LoadCurrentDeck

* update reference

* clean header in deck_manager.h
2025-02-22 14:21:02 +08:00
Mercury233 6bcc96d222 rename myfopen to mywfopen (#2691)
* use fopen in DataManager::ReadScriptFromFile

* rename myfopen to mywfopen

* use std namespace

---------

Co-authored-by: salix5 <salix5566@gmail.com>
2025-02-22 10:54:31 +08:00
salix5 cfe114f4e5 replace fprintf 2025-02-22 10:37:38 +08:00
salix5 c675547122 replace snprintf, sscanf 2025-02-22 10:37:38 +08:00
salix5 f5955f854f replace fopen, fclose, fgets 2025-02-22 10:37:38 +08:00
salix5 f82fd91216 fix bounds checking in DeckManager::LoadLFListSingle (#2685) 2025-02-21 15:02:15 +08:00
salix5 ad9a70691e fix DeckManager::CheckDeck (#2656)
* fix DeckManager::CheckDeck

* use MAX_CARD_ID
2025-01-31 17:09:58 +08:00
salix5 b57b331b65 move struct CardDataC, deck sort functions to data_manager.h (#2647)
* move struct CardDataC to data_manager.h

* update struct CardDataC

* move deck sort functions to DataManager

* update DeckBuilder::filter_effect
2025-01-14 13:25:16 +08:00
salix5 bb6ef1e1e6 static member DataManager::FileSystem (#2644) 2025-01-11 20:32:03 +08:00
salix5 aaa1d3cf9d fix ScriptReader (#2642)
* fix ScriptReader

* increase scriptBuffer

* fix DeckManager::LoadCurrentDeck
2025-01-04 19:34:48 +08:00
salix5 f2278ae751 use vector rbegin (#2628)
* use vector rbegin

* const reference

* use vector assign

* minor update

* init
2024-12-06 23:50:39 +08:00
salix5 7721bfe017 remove NULL (#2626) 2024-12-04 23:19:51 +08:00
salix5 48d53cda9f use wchar_t name in myfopen 2024-11-30 13:22:13 +08:00
salix5 b22ff21ace use macro _WIN32 2024-11-16 15:50:01 +08:00
salix5 48b01b838c remove wcscpy, wcscat (#2602)
* use wcsncpy

* fix FileSystem::TraversalDir

* avoid wcscat

* remove wcscat

* add BufferIO::CopyWideString

* struct Config: path string changed to wchar_t[256]

* Revert "use wcsncpy"

This reverts commit b05e0c96a3.

* check lastcategory, lastdeck

* fix Game::LoadConfig

max length of filename should be determined by file system

* remove wcscpy

* use BufferIO::CopyWideString

* fix UpdateDeck

* myfilesystem: use std functions

* DataManager: fix GetNumString (#2603)

* DataManager: fix FormatAttribute, FormatRace

* update FormatAttribute, FormatRace

* DataManager: fix FormatType

* update FormatType

* DataManager: fix FormatSetName

* DataManager: fix FormatLinkMarker

* merge

* DataManager: fix GetNumString

* rebuild class ustring16 from edopro version

* add stringw conversion

core::stringw in current version does not have data()

* add CGUITTFont::drawUstring

* use drawUstring

* update DrawShadowText

* fix Game::lpcstring

* fix DuelInfo::vic_string

* add PACK_MAX_SIZE

* add IsExtension (#2604)

* CGUITTFont: use override

* ustring16: only accept basic_string
2024-11-06 08:34:12 +08:00
salix5 a8ccdbb107 add wrapper function myfopen (#2582)
* add wrapper function myfopen

* open file with myfopen
2024-09-08 21:52:57 +08:00
salix5 2dd2263c44 use <cstring> functions (#2580) 2024-08-18 03:14:02 +08:00
salix5 848348ca9c deckManager: add LoadCurrentDeck, SaveDeckBuffer (#2571)
* update LoadDeck from int array

* update LoadDeck from std::istringstream

* reorder

* rename to LoadCurrentDeck

* akways clear current_deck in LoadCurrentDeck

* reorder

* change LoadDeck from std::istringstream

* set errorcode for TYPE_TOKEN

* use LoadDeck in export deck

* update LoadSide

* fix CheckDeck

* fix LoadLFListSingle

* minor fix

* add SaveDeckBuffer

* fix LoadSide

* update LoadDeck(Deck&, std::istringstream&
2024-08-11 05:06:08 +08:00
salix5 080d7781f0 clean config.h (#2568)
* move header files to game.h

* include mutex when necessary

* include myfilesystem.h when necessary

* include thread when necessary

* include string

* include GL when necessary

* remove #pragma once

* rename guard macro to YGOPRO_CONFIG_H

* fix warning C4456, C4458

* move GL to game.h

* use <cstring> functions

* include <wchar.h>
2024-08-11 05:05:20 +08:00
salix5 790252e650 check sizeof deckBuffer in LoadDeck (#2564)
* Revert "fix"

This reverts commit 51aa89407b.

* check sizeof deckBuffer in LoadDeck

* clear current_deck when selecting a wrong file
2024-06-18 16:54:59 +08:00