Merge pull request #1 from TASVideos/master

Update code to the newest
This commit is contained in:
owomomo 2019-01-03 12:55:21 +08:00 committed by GitHub
commit 29b06101d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 46 additions and 3487 deletions

View File

@ -148,26 +148,26 @@ function doexspriteai(s)
end end
elseif(s.ai=="AimOnce") then elseif(s.ai=="AimOnce") then
if(s.timer==0) then if(s.timer==0) then
s.vx,s.vy = get_vdir(s,vic) s.vx,s.vy = getvdir(s.x,s.y, vic.x,vic.y)
s.vx = s.vx * 2 s.vx = s.vx * 2
s.vy = s.vy * 2 s.vy = s.vy * 2
--s.vy = AND(timer,0x0F) / 8 - 1 --s.vy = AND(timer,0x0F) / 8 - 1
end end
elseif(s.ai=="AimDelayed") then elseif(s.ai=="AimDelayed") then
if(s.timer>=30 and s.timer<=33) then if(s.timer>=30 and s.timer<=33) then
local x,y = get_vdir(s,vic) local x,y = getvdir(s.x,s.y, vic.x,vic.y)
s.vx = (x+s.vx) s.vx = (x+s.vx)
s.vy = (y+s.vy) s.vy = (y+s.vy)
end end
elseif(s.ai=="AimRight") then elseif(s.ai=="AimRight") then
if(s.timer==0) then if(s.timer==0) then
s.vx,s.vy = get_vdir(s,vic) s.vx,s.vy = getvdir(s.x,s.y, vic.x,vic.y)
s.vx = s.vx * 2.5 s.vx = s.vx * 2.5
s.vy = s.vy * 1.5 s.vy = s.vy * 1.5
end end
elseif(s.ai=="AimLeft") then elseif(s.ai=="AimLeft") then
if(s.timer==0) then if(s.timer==0) then
s.vx,s.vy = get_vdir(s,vic) s.vx,s.vy = getvdir(s.x,s.y, vic.x,vic.y)
s.vx = s.vx * 1.5 s.vx = s.vx * 1.5
s.vy = s.vy * 2.5 s.vy = s.vy * 2.5
end end
@ -179,7 +179,7 @@ function doexspriteai(s)
s.vx=s.vx/1.1 s.vx=s.vx/1.1
s.vy=s.vy/1.1 s.vy=s.vy/1.1
elseif(s.timer==70) then elseif(s.timer==70) then
local x,y = get_vdir(s,vic) local x,y = getvdir(s.x,s.y, vic.x,vic.y)
s.vx = x*3 s.vx = x*3
s.vy = y*3 s.vy = y*3
end end

View File

@ -3348,30 +3348,6 @@ static void gui_drawline_internal(int x1, int y1, int x2, int y2, bool lastPixel
} }
} }
// draw a rect on gui_data
static void gui_drawbox_internal(int x1, int y1, int x2, int y2, uint32 colour) {
if (x1 > x2)
swap<int>(x1, x2);
if (y1 > y2)
swap<int>(y1, y2);
if (x1 < 0)
x1 = -1;
if (y1 < 0)
y1 = -1;
if (x2 >= LUA_SCREEN_WIDTH)
x2 = LUA_SCREEN_WIDTH;
if (y2 >= LUA_SCREEN_HEIGHT)
y2 = LUA_SCREEN_HEIGHT;
//gui_prepare();
gui_drawline_internal(x1, y1, x2, y1, true, colour);
gui_drawline_internal(x1, y2, x2, y2, true, colour);
gui_drawline_internal(x1, y1, x1, y2, true, colour);
gui_drawline_internal(x2, y1, x2, y2, true, colour);
}
// draw fill rect on gui_data // draw fill rect on gui_data
static void gui_fillbox_internal(int x1, int y1, int x2, int y2, uint32 colour) static void gui_fillbox_internal(int x1, int y1, int x2, int y2, uint32 colour)
{ {
@ -3399,6 +3375,38 @@ static void gui_fillbox_internal(int x1, int y1, int x2, int y2, uint32 colour)
} }
} }
// draw a rect on gui_data
static void gui_drawbox_internal(int x1, int y1, int x2, int y2, uint32 colour) {
if (x1 > x2)
swap<int>(x1, x2);
if (y1 > y2)
swap<int>(y1, y2);
if (x1 < 0)
x1 = -1;
if (y1 < 0)
y1 = -1;
if (x2 >= LUA_SCREEN_WIDTH)
x2 = LUA_SCREEN_WIDTH;
if (y2 >= LUA_SCREEN_HEIGHT)
y2 = LUA_SCREEN_HEIGHT;
//gui_prepare();
int h = y2 - y1 + 1;
int w = x2 - x1 + 1;
if(w < 2 || h < 2)
gui_fillbox_internal(x1,y1,x2,y2,colour);
else
{
gui_drawline_internal(x1, y1, x2, y1, true, colour); //top
gui_drawline_internal(x1, y2, x2, y2, true, colour); //bottom
gui_drawline_internal(x1, y1+1, x1, y2-1, true, colour); //left
gui_drawline_internal(x2, y1+1, x2, y2-1, true, colour); //right
}
}
enum enum
{ {
GUI_COLOUR_CLEAR GUI_COLOUR_CLEAR

View File

@ -1,30 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fceux", "vc10_fceux.vcxproj", "{6893EF44-FEA3-46DF-B236-C4C200F54294}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
PublicRelease|Win32 = PublicRelease|Win32
PublicRelease|x64 = PublicRelease|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6893EF44-FEA3-46DF-B236-C4C200F54294}.Debug|Win32.ActiveCfg = Debug|Win32
{6893EF44-FEA3-46DF-B236-C4C200F54294}.Debug|Win32.Build.0 = Debug|Win32
{6893EF44-FEA3-46DF-B236-C4C200F54294}.Debug|x64.ActiveCfg = Debug|Win32
{6893EF44-FEA3-46DF-B236-C4C200F54294}.PublicRelease|Win32.ActiveCfg = PublicRelease|Win32
{6893EF44-FEA3-46DF-B236-C4C200F54294}.PublicRelease|Win32.Build.0 = PublicRelease|Win32
{6893EF44-FEA3-46DF-B236-C4C200F54294}.PublicRelease|x64.ActiveCfg = PublicRelease|x64
{6893EF44-FEA3-46DF-B236-C4C200F54294}.PublicRelease|x64.Build.0 = PublicRelease|x64
{6893EF44-FEA3-46DF-B236-C4C200F54294}.Release|Win32.ActiveCfg = Release|Win32
{6893EF44-FEA3-46DF-B236-C4C200F54294}.Release|Win32.Build.0 = Release|Win32
{6893EF44-FEA3-46DF-B236-C4C200F54294}.Release|x64.ActiveCfg = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -68,6 +68,15 @@
<CharacterSet>NotSet</CharacterSet> <CharacterSet>NotSet</CharacterSet>
<PlatformToolset>v140_xp</PlatformToolset> <PlatformToolset>v140_xp</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<!-- change toolset if it doesnt exist, so people can use 2017 for now -->
<!-- I can't figure out how to detect if v140_xp is installed in 2017. I would like to use it if possible, but I guess not today -->
<PropertyGroup Label="Globals" Condition="!Exists('$(VCTargetsPath)\Platforms\$(Platform)\PlatformToolsets\v140_xp\Toolset.props')">
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Label="Globals" Condition="'$(v141_xp_Installed)'=='true'">
<PlatformToolset>v141_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Platforms\$(Platform)\PlatformToolsets\v140_xp\Microsoft.Cpp.$(Platform).v140_xp.props" Condition="Exists('$(VCTargetsPath)\Platforms\$(Platform)\PlatformToolsets\v140_xp\Microsoft.Cpp.$(Platform).v140_xp.props')"/>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings"> <ImportGroup Label="ExtensionSettings">
</ImportGroup> </ImportGroup>