Ticket #9019: 16bit_step2.patch
File 16bit_step2.patch, 2.5 KB (added by , 15 years ago) |
---|
-
dists/msvc8/scumm.vcproj
1 1 <?xml version="1.0" encoding="windows-1252"?> 2 2 <VisualStudioProject 3 3 ProjectType="Visual C++" 4 Version="8 ,00"4 Version="8.00" 5 5 Name="scumm" 6 6 ProjectGUID="{B6AFD548-63D2-40CD-A652-E87095AFCBAF}" 7 7 RootNamespace="scumm" … … 43 43 Optimization="0" 44 44 InlineFunctionExpansion="0" 45 45 AdditionalIncludeDirectories="../../;../../engines" 46 PreprocessorDefinitions="WIN32;_DEBUG;ENABLE_SCUMM_7_8;ENABLE_HE;USE_ZLIB;USE_MAD;USE_VORBIS "46 PreprocessorDefinitions="WIN32;_DEBUG;ENABLE_SCUMM_7_8;ENABLE_HE;USE_ZLIB;USE_MAD;USE_VORBIS; ENABLE_16BIT" 47 47 MinimalRebuild="true" 48 48 ExceptionHandling="1" 49 49 BasicRuntimeChecks="3" -
engines/scumm/he/cup_player_he.cpp
69 69 _sfxQueuePos = 0; 70 70 _lastSfxChannel = -1; 71 71 72 #ifdef ENABLE_16BIT 73 _offscreenBuffer = (uint8 *)malloc(_width * _height * 2); 74 memset(_offscreenBuffer, 0, _width * _height * 2); 75 #else 72 76 _offscreenBuffer = (uint8 *)malloc(_width * _height); 73 77 memset(_offscreenBuffer, 0, _width * _height); 78 #endif 74 79 75 80 opened = true; 76 81 } … … 91 96 } 92 97 93 98 void CUP_Player::play() { 99 #ifdef ENABLE_16BIT 100 while (!_vm->shouldQuit()) { 101 102 for (int16 y = 0; y < _height; y++) { 103 uint8 *dst = _offscreenBuffer + (y * _width * 2); 104 for (int16 x = 0; x < _width; x++) { 105 uint16 color = (x * y) & 0xFFFF; 106 *dst++ = color & 0xFF; 107 *dst++ = color >> 8; 108 } 109 } 110 Common::Rect r; 111 r.top = 0; 112 r.left = 0; 113 r.bottom = _height - 1; 114 r.right = _width - 1; 115 copyRectToScreen(r); 116 updateScreen(); 117 } 118 #else 94 119 while (parseNextHeaderTag(_fileStream)) { 95 120 if (_fileStream.ioFailed()) { 96 121 return; … … 116 141 _vm->parseEvents(); 117 142 ticks = _system->getMillis(); 118 143 } 144 #endif 119 145 } 120 146 121 147 void CUP_Player::copyRectToScreen(const Common::Rect &r) { 122 148 const uint8 *src = _offscreenBuffer + r.top * _width + r.left; 149 #ifdef ENABLE_16BIT 150 _system->copyRectToScreen(src, _width * 2, r.left, r.top, r.width() + 1, r.height() + 1); 151 #else 123 152 _system->copyRectToScreen(src, _width, r.left, r.top, r.width() + 1, r.height() + 1); 153 #endif 124 154 } 125 155 126 156 void CUP_Player::updateScreen() {