Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int ScreenToBitmap(int bitmapID, bool layer0trans){
- int q[4]; //array for loops, 0 is layer, 1 is combo pos.
- int x; int y; //grid positions for combos to bitmap.
- int cmb; int cset; int cmbx; int cmby;
- Screen_>SetRenderTarget(bitmapID);
- //Clear the bitmap to BLACK.
- Screen->Rectangle(0, 0, 0, BITMAP_RIGHT, BITMAP_LEFT, 0x0F, //black
- 100, 0, 0, 0, true, OP_OPAQUE);
- for ( q[0] = 0; q[0] <= 6; q++ ) {
- x = 0; y = 0;
- for ( q[1] = 0; q[1] < 176; q[1] ++ ) {
- cmb = GetLayerComboD(q[0], q[1]);
- cset = GetLayerComboC(q[0], q[1]);
- //Because drawing combo 0 wastes draws, and is superfluous, we don't do it.
- if ( cmb != 0 ) { //ignore blank combos.
- cmbx = ComboX(cmb); cmby = ComboY(cmb); //update the x/y.
- if ( q[0] == 0 ) { //layer 0
- //draw the combo to the bitmap, using the opacity arg param.
- DrawCombo(q[0], cmbx, cmby, cmb, 1, 1, cset, -1, -1, 0, 0, 0, 0, 0, layer0trans, OP_OPAQUE);
- }
- else {
- //not layer 0, so use trans pixels.
- DrawCombo(q[0], cmbx, cmby, cmb, 1, 1, cset, -1, -1, 0, 0, 0, 0, 0, true, OP_OPAQUE);
- }
- }
- }
- }
- Screen->SetRenderTarget(RT_SCREEN);
- return 1; //Return true when done.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement