植物明星大乱斗8


能帮到你的话,就给个赞吧 😘


文章目录

  • util.h
  • util.cpp
  • platform.h
  • platform.cpp
  • main.cpp
  • gameScene.h
  • gameScene.cpp

util.h

#pragma once
#include <graphics.h>
#include "camera.h"void flipImage(IMAGE* src, IMAGE* dst);void putImageAlpha(int x, int y, IMAGE* img);		//图像绘制(透明度)//裁剪任意位置的图并显示//在(dst_x, dst_y) 处 显示 (src_x, src_y), w, h 的 图
void putImageAlpha(int dst_x, int dst_y, int width, int height, IMAGE* img, int src_x, int src_y);void putLine(int x1, int y1, int x2, int y2);

util.cpp

#include "util.h"
#pragma comment(lib, "MSIMG32.LIB")		//AlphaBlendvoid flipImage(IMAGE* src, IMAGE* dst){int height = src->getheight();int width = src->getwidth();Resize(dst, width, height);auto srcPixels = GetImageBuffer(src);auto dstPixels = GetImageBuffer(dst);for (int h = 0; h < height; h++)for (int w = 0; w < width; w++)dstPixels[h * width + w] = srcPixels[h * width + width - 1 - w];
}void putImageAlpha(int x, int y, IMAGE* img) {int w = img->getwidth();int h = img->getheight();auto cameraX = Camera::getCamera().getPostion().x;auto cameraY = Camera::getCamera().getPostion().y;AlphaBlend(GetImageHDC(nullptr), x - cameraX, y - cameraY, w, h,GetImageHDC(img), 0, 0, w, h, { AC_SRC_OVER,0,255, AC_SRC_ALPHA });
}//在(dst_x, dst_y) 处 显示 (src_x, src_y), w, h 的 图
void putImageAlpha(int dst_x, int dst_y, int width, int height, IMAGE* img,int src_x, int src_y){int w = width;int h = height;//将(src_x, src_y), w, h 的图像 复制到 (dst_x, dst_y)处AlphaBlend(GetImageHDC(GetWorkingImage()), dst_x, dst_y, w, h,GetImageHDC(img), src_x, src_y, w, h, { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA });
}void putLine(int x1, int y1, int x2, int y2){auto cameraX = Camera::getCamera().getPostion().x;auto cameraY = Camera::getCamera().getPostion().y;line(x1 - cameraX, y1 - cameraY, x2 - cameraX, y2 - cameraY);
}

platform.h

#pragma once
#include <graphics.h>
#include "camera.h"
#include "util.h"extern bool isDebug;class Platform {//碰撞箱为一条直线struct CollisionShape{float y;			//线的高度float left, right;	//线的左右端点};public://渲染数据IMAGE* img = nullptr;POINT renderPos = { 0 };//碰撞数据CollisionShape shape;	//平台碰撞箱
public:void render() const;
};

platform.cpp

#include "platform.h"void Platform::render() const{putImageAlpha(renderPos.x, renderPos.y, img);if (isDebug) {setlinecolor(RGB(255, 0, 0));putLine(shape.left, shape.y, shape.right, shape.y);}
}

main.cpp

#include <Windows.h>		//windows要放在graphics之前
#include <graphics.h>
#include "menuScene.h"
#include "gameScene.h"
#include "selectorScene.h"
#include "sceneManager.h"
#include "util.h"
#include "atlas.h"
#include "platform.h"
#include <iostream>
using namespace std;#pragma comment(lib, "Winmm.lib")	//mciSendStringbool isDebug = false;IMAGE	imgMenuBackground;IMAGE	imgVS;										//VS艺术字IMAGE	img1P;										//文本
IMAGE	img2P;
IMAGE	img1PDesc;									//键位描述
IMAGE	img2PDesc;IMAGE	imgGraveStoneLeft;							//向左墓碑
IMAGE	imgGraveStoneRight;
IMAGE	imgSelectorTip;								//选择提示
IMAGE	imgSelectorBackground;IMAGE	img1PSelectorButtonIdleLeft;				//1P向左选择按钮默认
IMAGE	img1PSelectorButtonIdleRight;
IMAGE	img1PSelectorButtonDownLeft;
IMAGE	img1PSelectorButtonDownRight;				//1P向左选择按钮按下IMAGE	img2PSelectorButtonIdleLeft;
IMAGE	img2PSelectorButtonIdleRight;
IMAGE	img2PSelectorButtonDownLeft;
IMAGE	img2PSelectorButtonDownRight;IMAGE	imgPeaShooterSelectorBackgroundLeft;		//豌豆向左选择界面
IMAGE	imgPeaShooterSelectorBackgroundRight;
IMAGE	imgSunFlowerSelectorBackgroundLeft;			//向日葵向左选择界面
IMAGE	imgSunFlowerSelectorBackgroundRight;IMAGE	imgSky;										//天空
IMAGE	imgHills;									//山脉
IMAGE	imgLargePlatform;							//平台
IMAGE	imgSmallPlatform;IMAGE	img1PCursor;
IMAGE	img2PCursor;Atlas	atlasPeaShooterIdleLeft;			//豌豆向左
Atlas	atlasPeaShooterIdleRight;
Atlas	atlasPeaShooterRunLeft;
Atlas	atlasPeaShooterRunRight;
Atlas	atlasPeaShooterAttackExLeft;		//豌豆向左特殊攻击
Atlas	atlasPeaShooterAttackExRight;
Atlas	atlasPeaShooterDieLeft;				//向左死亡
Atlas	atlasPeaShooterDieRight;Atlas	atlasSunFlowerIdleLeft;				//向日葵
Atlas	atlasSunFlowerIdleRight;
Atlas	atlasSunFlowerRunLeft;
Atlas	atlasSunFlowerRunRight;
Atlas	atlasSunFlowerAttackExLeft;
Atlas	atlasSunFlowerAttackExRight;
Atlas	atlasSunFlowerDieLeft;
Atlas	atlasSunFlowerDieRight;IMAGE	imgPea;								//豌豆
Atlas	atlasPeaBreak;
Atlas	atlasSun;
Atlas	atlasSunExplode;					//太阳爆炸
Atlas	atlasSunEX;							//特殊动画
Atlas	atlasSunEXExplode;					//特殊爆炸
Atlas	atlasSunText;						//文本动画Atlas	atlasRunEffect;						//奔跑特效
Atlas	atlasJumpEffect;
Atlas	atlasLandEffect;IMAGE	img1PWinner;						//1P获胜文本
IMAGE	img2PWinner;
IMAGE	imgWinnerBar;						//获胜背景IMAGE	imgPeaShooterAvatar;				//豌豆头像
IMAGE	imgSunFlowerAvatar;					//向日葵头像//场景与场景管理器互相引用
Scene* menuScene = new MenuScene;
Scene* gameScene = new GameScene;
Scene* selectorScene = new SelectorScene;SceneManager sceneManager;vector<Platform> platforms;void flipAtlas(Atlas& src, Atlas& dst) {dst.clear();for (int i = 0; i < src.getSize(); i++) {IMAGE img;flipImage(src.getImage(i), &img);dst.addImage(img);}}void loadResources() {//加载字体//将 IPix.ttf" 加载到系统字体中,并将其设置为私有字体。AddFontResourceEx(_T("resources/IPix.ttf"), FR_PRIVATE, nullptr);//加载图片loadimage(&imgMenuBackground, _T("resources/menu_background.png"));loadimage(&imgVS, _T("resources/VS.png"));loadimage(&img1P, _T("resources/1P.png"));loadimage(&img2P, _T("resources/2P.png"));loadimage(&img1PDesc, _T("resources/1P_desc.png"));loadimage(&img2PDesc, _T("resources/2P_desc.png"));loadimage(&imgGraveStoneRight, _T("resources/gravestone.png"));flipImage(&imgGraveStoneRight, &imgGraveStoneLeft);loadimage(&imgSelectorTip, _T("resources/selector_tip.png"));loadimage(&imgSelectorBackground, _T("resources/selector_background.png"));loadimage(&img1PSelectorButtonIdleRight, _T("resources/1P_selector_btn_idle.png"));flipImage(&img1PSelectorButtonIdleRight, &img1PSelectorButtonIdleLeft);loadimage(&img1PSelectorButtonDownRight, _T("resources/1P_selector_btn_down.png"));flipImage(&img1PSelectorButtonDownRight, &img1PSelectorButtonDownLeft);loadimage(&img2PSelectorButtonIdleRight, _T("resources/2P_selector_btn_idle.png"));flipImage(&img2PSelectorButtonIdleRight, &img2PSelectorButtonIdleLeft);loadimage(&img2PSelectorButtonDownRight, _T("resources/2P_selector_btn_down.png"));flipImage(&img2PSelectorButtonDownRight, &img2PSelectorButtonDownLeft);loadimage(&imgPeaShooterSelectorBackgroundRight, _T("resources/peashooter_selector_background.png"));flipImage(&imgPeaShooterSelectorBackgroundRight, &imgPeaShooterSelectorBackgroundLeft);loadimage(&imgSunFlowerSelectorBackgroundRight, _T("resources/sunflower_selector_background.png"));flipImage(&imgSunFlowerSelectorBackgroundRight, &imgSunFlowerSelectorBackgroundLeft);loadimage(&imgSky, _T("resources/sky.png"));loadimage(&imgHills, _T("resources/hills.png"));loadimage(&imgLargePlatform, _T("resources/platform_large.png"));loadimage(&imgSmallPlatform, _T("resources/platform_small.png"));loadimage(&img1PCursor, _T("resources/1P_cursor.png"));loadimage(&img2PCursor, _T("resources/2P_cursor.png"));//豌豆射手atlasPeaShooterIdleRight.loadImages(_T("resources/peashooter_idle_%d.png"), 9);flipAtlas(atlasPeaShooterIdleRight, atlasPeaShooterIdleLeft);atlasPeaShooterRunRight.loadImages(_T("resources/peashooter_run_%d.png"), 5);flipAtlas(atlasPeaShooterRunRight, atlasPeaShooterRunLeft);atlasPeaShooterAttackExRight.loadImages(_T("resources/peashooter_attack_ex_%d.png"), 3);flipAtlas(atlasPeaShooterAttackExRight, atlasPeaShooterAttackExLeft);atlasPeaShooterDieRight.loadImages(_T("resources/peashooter_die_%d.png"), 4);flipAtlas(atlasPeaShooterDieRight, atlasPeaShooterDieLeft);//向日葵atlasSunFlowerIdleRight.loadImages(_T("resources/sunflower_idle_%d.png"), 8);flipAtlas(atlasSunFlowerIdleRight, atlasSunFlowerIdleLeft);atlasSunFlowerRunRight.loadImages(_T("resources/sunflower_run_%d.png"), 5);flipAtlas(atlasSunFlowerRunRight, atlasSunFlowerRunLeft);atlasSunFlowerAttackExRight.loadImages(_T("resources/sunflower_attack_ex_%d.png"), 9);flipAtlas(atlasSunFlowerAttackExRight, atlasSunFlowerAttackExLeft);atlasSunFlowerDieRight.loadImages(_T("resources/sunflower_die_%d.png"), 2);flipAtlas(atlasSunFlowerDieRight, atlasSunFlowerDieLeft);loadimage(&imgPea, _T("resources/pea.png"));atlasPeaBreak.loadImages(_T("resources/pea_break_%d.png"), 3);atlasSun.loadImages(_T("resources/sun_%d.png"), 5);atlasSunExplode.loadImages(_T("resources/sun_explode_%d.png"), 5);atlasSunEX.loadImages(_T("resources/sun_ex_%d.png"), 5);atlasSunEXExplode.loadImages(_T("resources/sun_ex_explode_%d.png"), 5);atlasSunText.loadImages(_T("resources/sun_text_%d.png"), 6);atlasRunEffect.loadImages(_T("resources/run_effect_%d.png"), 4);atlasJumpEffect.loadImages(_T("resources/jump_effect_%d.png"), 5);atlasLandEffect.loadImages(_T("resources/land_effect_%d.png"), 2);loadimage(&img1PWinner, _T("resources/1P_winner.png"));loadimage(&img2PWinner, _T("resources/2P_winner.png"));loadimage(&imgWinnerBar, _T("resources/winnner_bar.png"));loadimage(&imgPeaShooterAvatar, _T("resources/avatar_peashooter.png"));loadimage(&imgSunFlowerAvatar, _T("resources/avatar_sunflower.png"));
//加载音乐mciSendString(_T("open resources/bgm_game.mp3 alias bgmGame"), nullptr, 0, nullptr);mciSendString(_T("open resources/bgm_menu.mp3 alias bgmMenu"), nullptr, 0, nullptr);mciSendString(_T("open resources/pea_break_1.mp3 alias peaBreak1"), nullptr, 0, nullptr);mciSendString(_T("open resources/pea_break_2.mp3 alias peaBreak2"), nullptr, 0, nullptr);mciSendString(_T("open resources/pea_break_3.mp3 alias peaBreak3"), nullptr, 0, nullptr);mciSendString(_T("open resources/pea_shoot_1.mp3 alias peaShoot1"), nullptr, 0, nullptr);mciSendString(_T("open resources/pea_shoot_2.mp3 alias peaShoot2"), nullptr, 0, nullptr);mciSendString(_T("open resources/pea_shoot_ex.mp3 alias peaShootEx"), nullptr, 0, nullptr);mciSendString(_T("open resources/sun_explode.mp3 alias sunExplode"), nullptr, 0, nullptr);mciSendString(_T("open resources/sun_explode_ex.mp3 alias sunExplodeEx"), nullptr, 0, nullptr);mciSendString(_T("open resources/sun_text.mp3 alias sunText"), nullptr, 0, nullptr);mciSendString(_T("open resources/ui_confirm.wav alias uiConfirm"), nullptr, 0, nullptr);mciSendString(_T("open resources/ui_switch.wav alias uiSwitch"), nullptr, 0, nullptr);mciSendString(_T("open resources/ui_win.wav alias uiWin"), nullptr, 0, nullptr);
}int main() {//加载资源loadResources();//初始化管理器	sceneManager.setSceneManager(menuScene);ExMessage msg;const int FPS = 1000 / 60;initgraph(1280, 720, EW_SHOWCONSOLE);	//EW_SHOWCONSOLE//设置文本样式//要在initgraph才能设置settextstyle(28, 0, _T("IPix"));setbkmode(TRANSPARENT);BeginBatchDraw();while (1) {	auto startTime = GetTickCount64();//接收消息if(peekmessage(&msg))sceneManager.receiveInput(msg);//管理器运行的时间static auto managerLastTime = GetTickCount64();auto managerCurrentTime = GetTickCount64();sceneManager.update(managerCurrentTime - managerLastTime);managerLastTime = managerCurrentTime;cleardevice();//渲染sceneManager.render();FlushBatchDraw();//hertzauto excutionTime = GetTickCount64() - startTime;if (excutionTime < FPS)Sleep(FPS - excutionTime);}EndBatchDraw();//释放资源delete menuScene;delete gameScene;	}

gameScene.h

#pragma once
#include "scene.h"
#include "sceneManager.h"
#include "util.h"
#include "platform.h"extern IMAGE imgSky;									//天空
extern IMAGE imgHills;									//山脉
extern IMAGE imgLargePlatform;							//平台
extern IMAGE imgSmallPlatform;extern SceneManager sceneManager;
extern std::vector<Platform> platforms;class GameScene :public Scene {public:virtual void enter();								//场景进入——初始化所有场景对象virtual void exit();								//退出virtual void receiveInput(const ExMessage& msg);	//输入virtual void update(int runTimeMs);					//场景更新——让场景运行的时间virtual void render();								//渲染private://天空山脉 世界坐标POINT posImgSky = { 0 };						POINT posImgHills = { 0 };
};

gameScene.cpp

#include "gameScene.h"
#include <iostream>
#include "sceneManager.h"void GameScene::enter(){int xWindow = getwidth(), yWindow = getheight();//窗口居中posImgSky.x = (xWindow - imgSky.getwidth()) / 2,posImgSky.y = (yWindow - imgSky.getheight()) / 2;posImgHills.x = (xWindow - imgHills.getwidth()) / 2,posImgHills.y = (yWindow - imgHills.getheight()) / 2;//初始化平台platforms.resize(4);//largeauto& largePlatform = platforms[0];largePlatform.img = &imgLargePlatform;largePlatform.renderPos.x = 122, largePlatform.renderPos.y = 455;//碰撞箱 一般 位于 渲染图内部偏上largePlatform.shape.left = largePlatform.renderPos.x + 30,largePlatform.shape.right = largePlatform.renderPos.x + largePlatform.img->getwidth() - 30,largePlatform.shape.y = largePlatform.renderPos.y + 60;//small1auto& smallPlatform1 = platforms[1];smallPlatform1.img = &imgSmallPlatform;smallPlatform1.renderPos.x = 175, smallPlatform1.renderPos.y = 360;smallPlatform1.shape.left = smallPlatform1.renderPos.x + 40,smallPlatform1.shape.right = smallPlatform1.renderPos.x + smallPlatform1.img->getwidth() - 40,smallPlatform1.shape.y = smallPlatform1.renderPos.y + smallPlatform1.img->getheight() / 2;//small2auto& smallPlatform2 = platforms[2];smallPlatform2.img = &imgSmallPlatform;smallPlatform2.renderPos.x = 855, smallPlatform2.renderPos.y = 360;smallPlatform2.shape.left = smallPlatform2.renderPos.x + 40,smallPlatform2.shape.right = smallPlatform2.renderPos.x + smallPlatform2.img->getwidth() - 40,smallPlatform2.shape.y = smallPlatform2.renderPos.y + smallPlatform2.img->getheight() / 2;//small3auto& smallPlatform3 = platforms[3];smallPlatform3.img = &imgSmallPlatform;smallPlatform3.renderPos.x = 515, smallPlatform3.renderPos.y = 225;smallPlatform3.shape.left = smallPlatform3.renderPos.x + 40,smallPlatform3.shape.right = smallPlatform3.renderPos.x + smallPlatform3.img->getwidth() - 40,smallPlatform3.shape.y = smallPlatform3.renderPos.y + smallPlatform3.img->getheight() / 2;
}void GameScene::exit() {}void GameScene::receiveInput(const ExMessage& msg){switch (msg.message){case WM_KEYUP://qif (msg.vkcode == 0x51)isDebug = !isDebug;break;default:break;}
}void GameScene::update(int runTimeMs){}void GameScene::render(){putImageAlpha(posImgSky.x, posImgSky.y, &imgSky);putImageAlpha(posImgHills.x, posImgHills.y, &imgHills);for (const auto& platform : platforms)platform.render();if (isDebug) {settextcolor(RGB(255, 0, 0));outtextxy(15, 15, _T("调试模式已开启,按q关闭"));}
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/886033.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

51单片机应用开发(进阶)---定时器应用(电子时钟)

实现目标 1、巩固定时器的配置流程&#xff1b; 2、掌握按键、数码管与定时器配合使用&#xff1b; 3、功能1&#xff1a;&#xff08;1&#xff09;简单显示时间。显示格式&#xff1a;88-88-88&#xff08;时-分-秒&#xff09; 4、功能2&#xff1a;&#xff08;1&#…

FPGA实现PCIE采集电脑端视频转SFP光口万兆UDP输出,基于XDMA+GTX架构,提供2套工程源码和技术支持

目录 1、前言工程概述免责声明 2、相关方案推荐我已有的PCIE方案10G Ethernet Subsystem实现万兆以太网物理层方案 3、PCIE基础知识扫描4、工程详细设计方案工程设计原理框图电脑端视频PCIE视频采集QT上位机XDMA配置及使用XDMA中断模块FDMA图像缓存UDP视频组包发送UDP协议栈MAC…

使用 unicorn 和 capstone 库来模拟 ARM Thumb 指令的执行(一)

import binascii import unicorn import capstonedef printArm32Regs(mu):for i in range(66,78):print("R%d,value:%x"%(i-66,mu.reg_read(i)))def testhumb():CODE b\x1C\x00\x0A\x46\x1E\x00"""MOV R3, R0 的机器码&#xff1a;0x1C 0x00&#xf…

git重置的四种类型(Git Reset)

git区域概念 1.工作区:IDEA中红色显示文件为工作区中的文件 (还未使用git add命令加入暂存区) 2.暂存区:IDEA中绿色(本次还未提交的新增的文件显示为绿色)或者蓝色(本次修改的之前版本提交的文件但本次还未提交的文件显示为蓝色)显示的文件为暂存区中的文件&#xff08;使用了…

第三十一天|贪心算法| 56. 合并区间,738.单调递增的数字 , 968.监控二叉树

目录 56. 合并区间 方法1&#xff1a;fff 看方法2&#xff1a;fff优化版 方法3&#xff1a; 738.单调递增的数字 968.监控二叉树&#xff08;贪心二叉树&#xff09; 56. 合并区间 判断重叠区间问题&#xff0c;与452和435是一个套路 方法1&#xff1a;fff 看方法2&am…

LeetCode 热题100(八)【二叉树】(3)

目录 8.11二叉树展开为链表&#xff08;中等&#xff09; 8.12从前序与中序遍历序列构造二叉树&#xff08;中等&#xff09; 8.13路径总和III&#xff08;中等&#xff09; 8.14二叉树的最近公共祖先&#xff08;中等&#xff09; 8.15二叉树中的最大路径和&#xff08;困…

AutoSAR CP DoIP规范导读

主要功能和用途 诊断通信协议实现 遵循标准&#xff1a;遵循ISO 13400 - 2标准&#xff0c;实现了诊断通信在IP网络上的传输协议和网络层服务&#xff0c;包括数据封装、传输、路由等功能。 多种消息支持 车辆识别与公告&#xff1a;能够进行车辆识别请求和响应&#xff0c;…

Simulink中Matlab function使用全局变量

目录 一. 引言二. 普通Matlab function使用全局变量三. Simulink中的Matlab function使用全局变量四. 如何利用Matlab function的全局变量施加随机噪声 一. 引言 最近发现了之前仿真中的一个问题&#xff0c;记录一下备忘。 Matlab function中有时候需要用到全局变量&#xf…

屏幕缩放后截屏图片尺寸数字偏大导致前端DOM尺寸设置失真问题

如果显示器的尺寸缩放&#xff0c;而不是100%的话&#xff0c;利用截屏软件截取屏幕中的区域&#xff0c;截取时读取到的区域尺寸&#xff0c;就会失真&#xff1b;如果使用这个尺寸去设置网页中的DOM&#xff0c;则Dom的尺寸也会跟着失真。 比如&#xff0c; 如果使用失真…

蓝桥杯每日真题 - 第7天

题目&#xff1a;&#xff08;爬山&#xff09; 题目描述&#xff08;X届 C&C B组X题&#xff09; 解题思路&#xff1a; 前缀和构造&#xff1a;为了高效地计算子数组的和&#xff0c;我们可以先构造前缀和数组 a&#xff0c;其中 a[i] 表示从第 1 个元素到第 i 个元素的…

给阿里云OSS绑定域名并启用SSL

为什么要这么做&#xff1f; 问题描述&#xff1a; 当用户通过 OSS 域名访问文件时&#xff0c;OSS 会在响应头中增加 Content-Disposition: attachment 和 x-oss-force-download: true&#xff0c;导致文件被强制下载而不是预览。这个问题特别影响在 2022/10/09 之后新开通 OS…

电脑浏览器打不开网页怎么办 浏览器无法访问网页解决方法

我们在使用电脑的时候&#xff0c;使用浏览器是经常的&#xff0c;很多用户在点开浏览器时&#xff0c;却遇到浏览器无法访问网页的情况。那么电脑浏览器打不开网页是什么原因呢&#xff1f;今天小编就给大家分享几个常见的原因和具体的解决方法&#xff0c;希望能对大家有所帮…

(干货)Jenkins使用kubernetes插件连接k8s的认证方式

#Kubernetes插件简介 Kubernetes 插件的目的是能够使用 Kubernetes 配合&#xff0c;实现动态配置 Jenkins 代理&#xff08;使用 Kubernetes 调度机制来优化负载&#xff09;&#xff0c;在执行 Jenkins Job 构建时&#xff0c;Jenkins Master 会在 kubernetes 中创建一个 Sla…

C语言 | Leetcode C语言题解之第556题下一个更大元素III

题目&#xff1a; 题解&#xff1a; int nextGreaterElement(int n){int x n, cnt 1;for (; x > 10 && x / 10 % 10 > x % 10; x / 10) {cnt;}x / 10;if (x 0) {return -1;}int targetDigit x % 10;int x2 n, cnt2 0;for (; x2 % 10 < targetDigit; x2…

TDesign了解及使用

文章目录 1、概述2、快速开始2.1使用 npm 安装2.2通过 浏览器引入 安装2.3、使用 3、简单案例3.1 路由创建3.2、 页面创建3.3、 Table组件3.4、序号展示3.5、 图片展示及预览3.6、 性别字段处理 1、概述 TDesign 是腾讯推出的设计系统&#xff0c;旨在提供一致的设计语言和视觉…

计算机网络(11)和流量控制补充

这一篇对数据链路层中的和流量控制进行详细学习 流量控制&#xff08;Flow Control&#xff09;是计算机网络中确保数据流平稳传输的技术&#xff0c;旨在防止数据发送方发送过多数据&#xff0c;导致接收方的缓冲区溢出&#xff0c;进而造成数据丢失或传输失败。流量控制通常…

可扩展架构与分层架构

可扩展架构 1 概述 软件系统与硬件/建筑系统最大的区别就是可以迭代升级和扩展&#xff0c;一个硬件生产出来后就不会进行改变&#xff0c;除非拿去售后维修&#xff0c;一个建筑完工后也不会改变其整体的结构&#xff0c;除非被破坏后进行修复和重铸 可以发现如果硬件/建筑不…

MyBatis从入门到进阶

目录 MyBatis入门1、创建项目、数据准备2、数据库配置3、编写持久层代码单元测试打印日志 基本操作查询数据插入数据删除数据更新数据 MyBatis - xml插入数据更新数据删除数据查询数据#{}与${}SQL注入排序like查询 MyBatis进阶if标签trim标签where标签set标签foreach标签sql标签…

TensorFlow 2.0 环境配置

官方文档&#xff1a;CUDA Installation Guide for Windows 官方文档有坑&#xff0c;windows的安装指南直接复制了linux的指南内容&#xff1a;忽略这些离谱的信息即可。 可以从官方文档知悉&#xff0c;cuda依赖特定版本的C编译器。但是我懒得为了一个编译器就下载整个visua…

浅谈:基于三维场景的视频融合方法

视频融合技术的出现可以追溯到 1996 年 , Paul Debevec等 提出了与视点相关的纹理混合方法 。 也就是说 &#xff0c; 现实的漫游效果不是从摄像机的角度来看 &#xff0c; 但其仍然存在很多困难 。基于三维场景的视频融合 &#xff0c; 因其直观等特效在视频监控等相关领域有着…