|
-
May 17th, 2012, 07:15 AM
#1
How to accelerate c2flash
I spent a lot of time to find this tool to convert c++ to flash. So my c++ game can run in explorer. But the last flash swf runs too slow. Is there any way to optimize?
-
May 18th, 2012, 06:14 AM
#2
Re: How to accelerate c2flash
En~~~~~, If there is some code that occupies a lot of time,
and the work can be done parallelly.
You can try CBlockMemory::ParallelCompute & CBlockMemory::ParallelComputeIf
to save time.
The function prototype is
static int ParallelCompute(CBlockMemory & data1,int data1_start,int data1_step,CBlockMemory & data2,int data2_start,int data2_step,BOOL sign,int width,BOOL float_point,CBlockMemory & data3,int data3_start,int data3_step,int data3_width,EParallelOperator operator_,int count);
(ParallelComputeIf will be discussed later)
There are many parameters.
To explain them, there is an example:
Getting the sum of an int array.
int data[]={0,1,2,3,4,5,6,7,8,9};//The array stores data
int sum;//to get the sum
sum=0;
//ParallelCompute acceptes only CBlockMemory,convert
CBlockMemory data_buffer;
data_buffer.Write(0,data,sizeof(data));
CBlockMemory sum_buffer;
sum_buffer.Write(0,&sum,sizeof(sum));
//Get sum using ParallelCompute
CBlockMemory::ParallelCompute(
sum_buffer,//data1
0,//data1_start
0,//data1_step
data_buffer,//data2
0,//data2_start
sizeof(data[0]),//data2_step
TRUE,//sign
sizeof(sum)*8,//width
FALSE,//float_point
*(CBlockMemory*)NULL,//data3 (not used)
0,//data3_start
0,//data3_step
0,//data3_width,
PARALLEL_OPERATOR_ADD,//operator_
sizeof(data)/sizeof(data[0]));//count
sum_buffer.Read(&sum,sizeof(sum),0);
//finished, sum is the last result.
-
May 18th, 2012, 07:06 AM
#3
Re: How to accelerate c2flash
 Originally Posted by zhaolei_swf
I spent a lot of time to find this tool to convert c++ to flash. So my c++ game can run in explorer. But the last flash swf runs too slow. Is there any way to optimize?
What is c2flash?
EDIT: Please post the questions in relevant section.
Last edited by Ejaz; May 18th, 2012 at 07:11 AM.
-
May 18th, 2012, 07:07 AM
#4
Re: How to accelerate c2flash
 Originally Posted by zhaolei_cpp
En~~~~~, If there is some code that occupies a lot of time,
and the work can be done parallelly.
You can try CBlockMemory::ParallelCompute & CBlockMemory::ParallelComputeIf
to save time.
The function prototype is
static int ParallelCompute(CBlockMemory & data1,int data1_start,int data1_step,CBlockMemory & data2,int data2_start,int data2_step,BOOL sign,int width,BOOL float_point,CBlockMemory & data3,int data3_start,int data3_step,int data3_width,EParallelOperator operator_,int count);
(ParallelComputeIf will be discussed later)
There are many parameters.
To explain them, there is an example:
Getting the sum of an int array.
int data[]={0,1,2,3,4,5,6,7,8,9};//The array stores data
int sum;//to get the sum
sum=0;
//ParallelCompute acceptes only CBlockMemory,convert
CBlockMemory data_buffer;
data_buffer.Write(0,data,sizeof(data));
CBlockMemory sum_buffer;
sum_buffer.Write(0,&sum,sizeof(sum));
//Get sum using ParallelCompute
CBlockMemory::ParallelCompute(
sum_buffer,//data1
0,//data1_start
0,//data1_step
data_buffer,//data2
0,//data2_start
sizeof(data[0]),//data2_step
TRUE,//sign
sizeof(sum)*8,//width
FALSE,//float_point
*(CBlockMemory*)NULL,//data3 (not used)
0,//data3_start
0,//data3_step
0,//data3_width,
PARALLEL_OPERATOR_ADD,//operator_
sizeof(data)/sizeof(data[0]));//count
sum_buffer.Read(&sum,sizeof(sum),0);
//finished, sum is the last result.
What *is* this?
-
May 18th, 2012, 07:32 AM
#5
Re: How to accelerate c2flash
He answered to himself, from a different account.
The same question & answer can be found on codeproject.com!
-
May 18th, 2012, 07:36 AM
#6
Re: How to accelerate c2flash
 Originally Posted by TomasRiker
He answered to himself, from a different account.
The same question & answer can be found on codeproject.com!
Great 
How much time people have to waste on useless activities like that
-
May 18th, 2012, 08:35 AM
#7
Re: How to accelerate c2flash
I am quite different from zhaolei_cpp, he is a c/c++ programmer, while I am a Flash as programmer. Both of us work for zhaolei company.
-
May 18th, 2012, 12:36 PM
#8
Re: How to accelerate c2flash
 Originally Posted by TomasRiker
He answered to himself, from a different account.
The same question & answer can be found on codeproject.com!
Hi Tomas, I visited "Derivative Calculator", I believe that if users can input formatted math formula, your calculator could be better. why not just have a try?
I believe that you are very good at c/c++, but you can not develop a web site calculator just by c/c++.
by the way three accounts in codeproject is deleted.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|