holy sheet. Ingenious!
Ill get right to it, good news is now I can reuse this in other places too
Ill get right to it, good news is now I can reuse this in other places too

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
function btnQuickGuide_PrevPg_OnClick(GUIControl *control, MouseButton button, int iMode)
{
if (iMode == 0)...stuff;
else ...stuff;
}
Called from inside a key press: btnQuickGuide_PrevPg_OnClick(btnQuickGuideVC_PrevPg, eMouseLeft, 1);
QuoteThis made me laugh, which means it was a success.
(Formerly known as global function StrContains, which is now obsolete)
(Formerly known as String.Contains, which is now obsolete)
String.IndexOf(string needle)
Checks to see if NEEDLE is contained within the specified string. Returns the character position of the match if it is, or -1 if it is not.
This function is not case sensitive; ie. testing "test string" for "sTRiN" would match.
Example:
String haystack = "The haystack had a needle in it somewhere.";
int result = haystack.IndexOf("a needle");
if (result == -1) {
Display("The string didn't contain the needle.");
}
else {
Display("a needle was found starting at character %d in the string.", result);
}
See Also: String.EndsWith, String.StartsWith
if (mouse.IsButtonDown(eMouseLeft) && gQuickGuidesGUI.Visible)
{
if (overGUI == gQuickGuidePC)
{
iPCz = gQuickGuidePC.ZOrder;
if (iPCz != 10)
{
gQuickGuidePC.ZOrder = 10;
iVCz = gQuickGuideVC.ZOrder;
iSSz = gQuickGuideSS.ZOrder;
if (iVCz == 10) gQuickGuideVC.ZOrder = 9;
else if (iVCz == 9) gQuickGuideVC.ZOrder = 8;
else if (iSSz == 10) gQuickGuideSS.ZOrder = 9;
else if (iSSz == 9) gQuickGuideSS.ZOrder = 8;
}
}
else if (overGUI == gQuickGuideVC)
{
iVCz = gQuickGuideVC.ZOrder;
if (iVCz != 10)
{
gQuickGuideVC.ZOrder = 10;
iPCz = gQuickGuidePC.ZOrder;
iSSz = gQuickGuideSS.ZOrder;
if (iPCz == 10) gQuickGuidePC.ZOrder = 9;
else if (iPCz == 9) gQuickGuidePC.ZOrder = 8;
else if (iSSz == 10) gQuickGuideSS.ZOrder = 9;
else if (iSSz == 9) gQuickGuideSS.ZOrder = 8;
}
}
else if (overGUI == gQuickGuideSS)
{
iSSz = gQuickGuideSS.ZOrder;
if (iSSz != 10)
{
gQuickGuideSS.ZOrder = 10;
iVCz = gQuickGuideVC.ZOrder;
iPCz = gQuickGuidePC.ZOrder;
if (iVCz == 10) gQuickGuideVC.ZOrder = 9;
else if (iVCz == 9) gQuickGuideVC.ZOrder = 8;
else if (iPCz == 10) gQuickGuidePC.ZOrder = 9;
else if (iPCz == 9) gQuickGuidePC.ZOrder = 8;
}
}
}
//Pseudo code:
iMyItemCount = myInventoryWindow.ItemCount;
int i = 0;
while (i < iMyItemCount)
{
functionThatDeletesItemFromInvWindow(); //processes 1 item at a time, to see if it must be deleted
i++;
}
Quote
Multimedia Class Scheduler Service
The Multimedia Class Scheduler service (MMCSS) enables multimedia applications to ensure that their time-sensitive processing receives prioritized access to CPU resources. This service enables multimedia applications to utilize as much of the CPU as possible without denying CPU resources to lower-priority applications.
MMCSS uses information stored in the registry to identify supported tasks and determine the relative priority of threads performing these tasks. Each thread that is performing work related to a particular task calls the AvSetMmMaxThreadCharacteristics or AvSetMmThreadCharacteristics function to inform MMCSS that it is working on that task.
For an example of a program that uses MMCSS, see Exclusive-Mode Streams.
Windows Server 2003 and Windows XP/2000: MMCSS is not available.
Registry Settings
The MMCSS settings are stored in the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile
This key contains a REG_DWORD value named SystemResponsiveness that determines the percentage of CPU resources that should be guaranteed to low-priority tasks. For example, if this value is 20, then 20% of CPU resources are reserved for low-priority tasks. Note that values that are not evenly divisible by 10 are rounded up to the nearest multiple of 10. A value of 0 is also treated as 10.
The key also contains a subkey named Tasks that contains the list of tasks. By default, Windows supports the following tasks:
•Audio
•Capture
•Distribution
•Games
•Playback
•Pro Audio
•Window Manager
OEMs can add additional tasks as required.
Each task key contains the following set of values that represent characteristics to be applied to threads that are associated with the task.
Thread Priorities
The MMCSS boosts the priority of threads that are working on high-priority multimedia tasks.
MMCSS determines the priority of a thread using the following factors:
•The base priority of the task.
•The Priority parameter of the AvSetMmThreadPriority function.
•Whether the application is in the foreground.
•How much CPU time is being consumed by the threads in each category.
MMCSS sets the priority of client threads depending on their scheduling category.
Quote
A Windows Media Player Trick
This pertains mainly to load times, but you may see an increase in FPS as well. Next time you run Counter-strike 1.6 or Source try leaving Windows media player idly running in the background (obviously not playing any songs). Apparently Windows Media Player will speed up the performance of your computer due to a service that it uses called, “Multimedia Class Scheduler Serviceâ€.
This article on wikipedia explains this service and what it does to help you gain performance. Here is a quick excerpt from the article:
“Multimedia Class Scheduler Service (MMCSS) is a Windows service that boosts the CPU as well as I/O priority of a thread. It allows an application to get prioritized access to CPU for time-sensitive processing (such as multimedia applications) as well as prioritized disc access to ensure that the process is not starved of data to process. The MMCSS service monitors the CPU load and dynamically adjusts priority so that the application can use as much CPU time as possible without denying CPU to lower priority applications.â€
So from the sounds of it, any of you that have already tweaked steam to run in low processor affinity through this tweak guide, may see almost no performance gain. Still, it’s worth a shot? Post comments if you noticed a difference in speed.
while (j < iConstantNum)
{
if (this == iUseItemsA)
{
if (aArrayA[j].GetProperty("CustomPropertyA") == false)
{
...do stuff with arrayA...
}
}
else if (this == iUseItemsB)
{
if (aArrayB[j].GetProperty("CustomPropertyB") == false)
{
...do exact same stuff as above but with arrayB
}
}
}
//(in .ash):
#define SL_A_ITEMS 6
import InventoryItem* aArrayA[SL_A_ITEMS];
#define SL_B_ITEMS 6
import InventoryItem* aArrayB[SL_B_ITEMS];
//(in .asc):
InventoryItem* aArrayA[SL_A_ITEMS];
InventoryItem* aArrayB[SL_B_ITEMS];
void ItemLists()
{
aArrayA[0] = iMic; aArrayA[1] = iRadio; aArrayA[2] = iBattery; aArrayA[3] = iKeysA; aArrayA[4] = iGun; aArrayA[5] = iPatrolClip;
aArrayB[0] = iSpray; aArrayB[1] = iMints; aArrayB[2] = iMeds; aArrayB[3] = iShield; aArrayB[4] = iMask; aArrayB[5] = iSanitizer;
}
//in some function:
{
if (this == iUseItemsA) aVariableArray[j] = aArrayA[];
else if (this == iUseItemsB) aVariableArray[j] = aArrayB[];
if (bEx == false)
{
j = 0;
while (j < iConstantNum)
{
if (aVariableArray[j].GetProperty("CustomPropertyA") == false)
{
...blah etc...
//pseudo code **EDIT**
while (j < iConstantNum)
{
if (blah)
{
if (aArrayA[j].GetProperty("CustomPropertyA") == false)
{
...stuff
}
}
}
OR:
while (j < iConstantNum)
{
if (blah)
{
if (aArrayB[j].GetProperty("CustomPropertyB") == false)
{
...stuff
}
}
}
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.093 seconds with 14 queries.