Skip to content

Commit

Permalink
Merge pull request #1605 from wiremod/fix/1602
Browse files Browse the repository at this point in the history
Allow wire_cpu_compile_speed > 256 in singleplayer
  • Loading branch information
AbigailBuccaneer authored Mar 21, 2018
2 parents bb5350b + 7546929 commit 93ece04
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions lua/wire/cpulib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if CLIENT then

-- Convars to control CPULib
local wire_cpu_upload_speed = CreateClientConVar("wire_cpu_upload_speed",1000,false,false)
local wire_cpu_compile_speed = CreateClientConVar("wire_cpu_compile_speed",128,false,false)
local wire_cpu_compile_speed = CreateClientConVar("wire_cpu_compile_speed",256,false,false)
local wire_cpu_show_all_registers = CreateClientConVar("wire_cpu_show_all_registers",0,false,false)

------------------------------------------------------------------------------
Expand Down Expand Up @@ -140,9 +140,8 @@ if CLIENT then
-- Compiler timer
function CPULib.OnCompileTimer()
local compile_speed = wire_cpu_compile_speed:GetFloat()
if game.SinglePlayer() then compile_speed = 256 end

for iteration=1,compile_speed do
for _ = 1, compile_speed do
local status,result = pcall(HCOMP.Compile,HCOMP)
if not status then
print("==================================================")
Expand Down Expand Up @@ -183,7 +182,7 @@ if CLIENT then
local iters = math.min(upload_speed, CPULib.RemainingUploadData)
net.Start("wire_cpulib_buffer")
net.WriteUInt(iters, 16)
for iteration=1,iters do
for _ = 1, iters do
local index,value = next(CPULib.RemainingData)
CPULib.RemainingUploadData = CPULib.RemainingUploadData - 1
net.WriteUInt(index, 24)
Expand Down Expand Up @@ -347,8 +346,6 @@ if CLIENT then
if ZCPU_Editor then
-- Highlight current position
local currentPosition = CPULib.Debugger.PositionByPointer[CPULib.Debugger.Variables.IP]
local sourceTab
local clearEditors = {}

if currentPosition then
-- Clear all highlighted lines
Expand Down Expand Up @@ -392,7 +389,6 @@ if CLIENT then

------------------------------------------------------------------------------
-- Debug data arrived from server
local previousLine = nil
function CPULib.OnDebugData_Registers(um)
CPULib.Debugger.Variables.IP = um:ReadFloat()
CPULib.Debugger.Variables.EAX = um:ReadFloat()
Expand Down Expand Up @@ -439,10 +435,6 @@ if CLIENT then
browserWindow:SetTitle("Documentation")
browserWindow:SetPos((ScrW() - w)/2, (ScrH() - h)/2)
browserWindow:SetSize(w,h)
browserWindow.OnClose = function()
browser = nil
browserWindow = nil
end
browserWindow:MakePopup()

local browser = vgui.Create("DHTML",browserWindow)
Expand Down Expand Up @@ -494,7 +486,7 @@ if SERVER then
if (not Buffer) or (Buffer.Player ~= player) then return end
if not Buffer.Entity then return end

for iteration=1, net.ReadUInt(16) do
for _ = 1, net.ReadUInt(16) do
Buffer.Data[net.ReadUInt(24)] = net.ReadDouble()
end

Expand Down Expand Up @@ -735,7 +727,7 @@ end
--------------------------------------------------------------------------------
-- Generate a serial number
--------------------------------------------------------------------------------
local sessionBase
local sessionBase, sessionDate
function CPULib.GenerateSN(entityType)
local currentDate = os.date("*t")

Expand Down

0 comments on commit 93ece04

Please sign in to comment.