Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » Know what you're using. Size of some common types.
Re: Know what you're using. Size of some common types. [message #57931 is a reply to message #57914] Tue, 28 December 2021 20:27 Go to previous messageGo to previous message
Lance is currently offline  Lance
Messages: 527
Registered: March 2007
Contributor
Novo:

By moving similarly algined items together (combined two seperated bitfield section, and move int8 item together with them)
	int8    push;
	int8    light;
	bool    horz:1;
	bool    jump:1;
	bool    track:1;
	bool    autohide:1;
	bool    autodisable:1;
	bool    is_active:1;

We can save like 16 bytes on 64 bit platform. If we try harder, like declaring linesize, etc as int8, we can save some more bytes. But these are all marginal.

What I have in mind is to get rid of the 4 Buttons completely. That way we can save around 1K in each ScrollBar object. ScrollBar is definitely a class that is worth rewritten. The rewriting work might even not be too difficult.

Here is a function from ScrollBar.cpp
int  SkrollBar::GetMousePart()
{
	int q = -1;
	for(int i = 2; i >= 0; i--)
		if(HasMouseIn(GetPartRect(i))) {
			q = i;
			break;
		}
	return q;
}

The slider area is divided into 3 parts, the upper blank area, the slider button, the bottom blank area. We can divide it into 5(or seven), with addition to accomodate prev,next (and even prev2, next2: anybody can ecudate me on what these two buttons are doing? I don't see it on the GUI at all)

These kind of refinement do not add functionalities but still contribute to a better U++ experience.

[Updated on: Tue, 28 December 2021 20:36]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [SOLVED][Question] Is anyone able to build UPP and Binaries based upon it as 32-Bit?
Next Topic: Source Code Efficiency Minor Issue
Goto Forum:
  


Current Time: Sat May 04 01:19:33 CEST 2024

Total time taken to generate the page: 0.02591 seconds