feat(game): 实现精灵图渲染优化游戏性能

- 新增 AnimalSpriteImage 组件用于精灵图渲染
- 集成精灵图渲染到桌面版动物组件
- 集成精灵图渲染到移动版动物组件
- 重构历史记录组件使用精灵图渲染
- 更新动物覆盖层组件使用精灵图渲染
- 移除旧的单个图片资源引用
- 添加精灵图生成脚本和相关配置
- 优化启动资源加载排除精灵图源文件
- 添加精灵图位置计算工具函数
This commit is contained in:
JiaJun
2026-06-10 16:38:00 +08:00
parent da8adc336d
commit c3059549e6
20 changed files with 652 additions and 135 deletions

View File

@@ -2,7 +2,6 @@ import { useQuery } from '@tanstack/react-query'
import { useMemo } from 'react'
import { getGamePeriodHistory } from '@/api'
import { FLOWER_IMAGE_BY_ID } from '@/features/game/shared'
import type { GamePeriodHistoryItemDto, PeriodHistoryDisplayItem } from '@/type'
export type { PeriodHistoryDisplayItem } from '@/type'
@@ -23,9 +22,9 @@ export function toPeriodHistoryDisplayItem(
item: GamePeriodHistoryItemDto,
): PeriodHistoryDisplayItem {
return {
animalId: item.result_number,
displayPeriodNo: formatPeriodNo(item.period_no),
displayResultNumber: formatResultNumber(item.result_number),
image: FLOWER_IMAGE_BY_ID[item.result_number]?.animalUrl ?? '',
isOdd: item.result_number % 2 === 1,
openTime: item.open_time,
periodNo: item.period_no,