|
| |||||||
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 (permalink) |
| COMPLETE BLOODY BASTARD ![]() ![]() | Let's look at one function here, shall we? Code: function ENT:SendPixel()
if (self.Clk >= 1) && (self.CharX >= 0) && (self.CharX < 30) &&
(self.CharY >= 0) && (self.CharY < 18) then
local address = math.floor(self.CharY)*30+math.floor(self.CharX)
self.Memory[address*2] = self.Char
local rp = RecipientFilter()
rp:AddAllPlayers()
umsg.Start("consolescreen_datamessage", rp)
umsg.Long(self:EntIndex())
umsg.Long(self.Clk)
umsg.Long(1)
umsg.Long(address*2)
umsg.Float(self.Char)
umsg.End()
self.Memory[address*2+1] = self.CharParam
local rp = RecipientFilter()
rp:AddAllPlayers()
umsg.Start("consolescreen_datamessage", rp)
umsg.Long(self:EntIndex())
umsg.Long(self.Clk)
umsg.Long(1)
umsg.Long(address*2+1)
umsg.Float(self.CharParam)
umsg.End()
end
end
__________________ “A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away.” —Antoine De Saint-Exupery |
| | |
| Sponsored Links | |
| | #2 (permalink) |
| Wire Guru ![]() ![]() | 1) That function get's called rare enough 2) Highspeed link interface uses caching 3) It's a long value, not bool. They can get really big. Entity is 100% same as entity index, I like it more this way Long value - it's size of cache, 1. Console screen uses ugly caching, because data that gets written to it is usually terribly sequenced anyway You see, saving 2 bytes when this gets used only max 20 times a second is not nice. Even more, saving 2 bytes in 254 vs 256 bytes is not nice too. I'll stick those two usermessages in one later, it's code from long time ago before caching was there Last edited by Black Phoenix; 10-10-2008 at 05:53 AM.. |
| | |
| | #3 (permalink) |
| COMPLETE BLOODY BASTARD ![]() ![]() | It wasn't how the function was doing it that was my complaint, it was the usermessage format in general. Also, get rid of caching in singleplayer plzplzplz?
__________________ “A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away.” —Antoine De Saint-Exupery |
| | |
| | #4 (permalink) | |
| Wire Guru ![]() ![]() | Quote:
| |
| | |
| Sponsored Links | |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|