mirror of
https://github.com/motajs/template.git
synced 2026-11-04 00:04:32 +08:00
refactor(type): material types.
This commit is contained in:
1 parent
9b51b6a1ce
commit
4e305e392a
19 files changed
+80
-87
No files matched your search
@@ -10,7 +10,7 @@ import {
|
||||
} from '@motajs/audio';
|
||||
import { IRenderTreeRoot, MotaRenderer } from '@motajs/render';
|
||||
import {
|
||||
IMaterialManager,
|
||||
ITextureManager,
|
||||
IAutotileProcessor,
|
||||
MaterialManager,
|
||||
AutotileProcessor,
|
||||
@@ -47,7 +47,7 @@ export class ClientCore extends CoreState implements IClientCore {
|
||||
readonly save: ISaveSystem;
|
||||
|
||||
// Layer 5 渲染顶层
|
||||
readonly materials: IMaterialManager;
|
||||
readonly materials: ITextureManager;
|
||||
readonly autotile: IAutotileProcessor;
|
||||
|
||||
readonly rafExcitation: IExcitation<number>;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ITexture } from '@motajs/render';
|
||||
import {
|
||||
IBlockIdentifier,
|
||||
IMaterialManager,
|
||||
ITextureManager,
|
||||
IIndexedIdentifier
|
||||
} from '@user/client-base';
|
||||
import { isNil } from 'lodash-es';
|
||||
@@ -50,7 +50,7 @@ function addAutotile(set: Set<number>, map?: readonly (readonly number[])[]) {
|
||||
/**
|
||||
* 兼容旧版加载
|
||||
*/
|
||||
export function fallbackLoad(materials: IMaterialManager) {
|
||||
export function fallbackLoad(materials: ITextureManager) {
|
||||
// 基本素材
|
||||
const icons = core.icons.icons;
|
||||
const images = core.material.images;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { linear, TimingFn } from 'mutate-animate';
|
||||
import { IMapRenderer, IMapVertexGenerator, IMovingBlock } from './types';
|
||||
import { IMaterialFramedData, IMaterialManager } from '@user/client-base';
|
||||
import { IMaterialFramedData, ITextureManager } from '@user/client-base';
|
||||
import { logger } from '@motajs/common';
|
||||
import { IMapLayer } from '@user/data-base';
|
||||
import { DynamicBlockStatus } from './status';
|
||||
|
||||
export interface IMovingRenderer {
|
||||
/** 素材管理器 */
|
||||
readonly manager: IMaterialManager;
|
||||
readonly manager: ITextureManager;
|
||||
/** 顶点数组生成器 */
|
||||
readonly vertex: IMapVertexGenerator;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
BlockCls,
|
||||
IAutotileProcessor,
|
||||
IMaterialFramedData,
|
||||
IMaterialManager,
|
||||
ITextureManager,
|
||||
ITrackedAssetData
|
||||
} from '@user/client-base';
|
||||
import {
|
||||
@@ -214,7 +214,7 @@ export class MapRenderer
|
||||
* 创建地图渲染器
|
||||
* @param manager 素材管理器
|
||||
*/
|
||||
constructor(readonly manager: IMaterialManager) {
|
||||
constructor(readonly manager: ITextureManager) {
|
||||
this.movingIndexPool.push(
|
||||
...Array.from({ length: this.movingCount }, (_, i) => i).reverse()
|
||||
);
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
import {
|
||||
IAutotileProcessor,
|
||||
IMaterialFramedData,
|
||||
IMaterialManager,
|
||||
ITextureManager,
|
||||
ITrackedAssetData
|
||||
} from '@user/client-base';
|
||||
import { IGameMap, IMapLayer } from '@user/data-base';
|
||||
@@ -326,7 +326,7 @@ export interface IMapRenderResult {
|
||||
|
||||
export interface IMapRenderer {
|
||||
/** 地图渲染器使用的资源管理器 */
|
||||
readonly manager: IMaterialManager;
|
||||
readonly manager: ITextureManager;
|
||||
/** 画布渲染上下文 */
|
||||
readonly gl: WebGL2RenderingContext;
|
||||
|
||||
|
||||
@@ -1,18 +1,12 @@
|
||||
import { IClientSystem } from '@user/client-system';
|
||||
import { IMapExtensionManager, IMapRenderer } from './render/map';
|
||||
import { IClientBase } from '@user/client-base';
|
||||
import { IExcitation, IExcitationDivider } from '@motajs/animate';
|
||||
|
||||
export interface IClientCoreConfig {
|
||||
/** 渲染端数据配置文件路径,相对于 `src/content` */
|
||||
readonly clientURL: string;
|
||||
}
|
||||
|
||||
export interface IClientCore extends IClientBase {
|
||||
/** 用于渲染系统的 Raf 激励源 */
|
||||
readonly rafExcitation: IExcitation<number>;
|
||||
/** 用于渲染系统的激励源分频器 */
|
||||
readonly excitationDivider: IExcitationDivider<number>;
|
||||
|
||||
export interface IClientCore extends IClientSystem {
|
||||
/** 主地图渲染器,主要用于渲染游戏画面中的地图 */
|
||||
readonly mainMapRenderer: IMapRenderer;
|
||||
/** 副地图渲染器,主要用于渲染缩略图、浏览地图等内容 */
|
||||
|
||||
Reference in new issue
Block a user