Changeset 719
- Timestamp:
- Sep 23, 2013, 11:03:03 PM (9 years ago)
- Location:
- abuse/branches/lol/src
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
abuse/branches/lol/src/automap.cpp
r715 r719 145 145 146 146 // set the clip back to full window size because soemthing else could mess with the area 147 automap_window->m_surf->SetClip(ivec2 (0), screen->Size());147 automap_window->m_surf->SetClip(ivec2::zero, screen->Size()); 148 148 } 149 149 … … 160 160 old_dy = -1000; 161 161 162 automap_window = wm->CreateWindow(ivec2 (0), ivec2(w * AUTOTILE_WIDTH,162 automap_window = wm->CreateWindow(ivec2::zero, ivec2(w * AUTOTILE_WIDTH, 163 163 h * AUTOTILE_HEIGHT), "Map"); 164 164 automap_window->m_surf->Bar(ivec2(17, 1), ivec2(17 + 8 * 6 + 3, 6), -
abuse/branches/lol/src/chars.h
r642 r719 90 90 ~CharacterType(); 91 91 92 uint16_t ts,tiv,tv; // total states, total index vars, total local vars93 sequence **seq; 92 int ts, tiv, tv; // total states, total index vars, total local vars 93 sequence **seq; // [0..ts-1] 94 94 LSymbol **seq_syms; // symbol describing what this state is [0..ts-1] 95 95 -
abuse/branches/lol/src/cop.cpp
r716 r719 587 587 o->set_state((character_state)S_climbing); 588 588 o->set_gravity(0); 589 o->m_vel = ivec2 (0);590 o->m_accel = ivec2 (0);589 o->m_vel = ivec2::zero; 590 o->m_accel = ivec2::zero; 591 591 return 0; 592 592 } else -
abuse/branches/lol/src/game.cpp
r718 r719 120 120 widgets << new AButton(ivec2(0, 0), ID_QUIT_OK, "Quit"); 121 121 widgets << new AInfoField(ivec2(0, wm->font()->Size().y * 2), ID_NULL, no_space_msg); 122 AWindow *no_space = wm->CreateWindow(ivec2 (0), ivec2(-1), "ERROR", widgets);122 AWindow *no_space = wm->CreateWindow(ivec2::zero, ivec2(-1), "ERROR", widgets); 123 123 124 124 Event ev; … … 1969 1969 void Game::draw(int scene_mode) 1970 1970 { 1971 main_screen->AddDirty(ivec2 (0), ivec2(xres, yres));1971 main_screen->AddDirty(ivec2::zero, ivec2(xres, yres)); 1972 1972 1973 1973 main_screen->clear(); -
abuse/branches/lol/src/gui.cpp
r716 r719 103 103 int g = 80; 104 104 screen->Bar(ivec2(0, 0), ivec2(144, 20), 0); 105 wm->font()->PutString(screen, ivec2 (0), symbol_str(key),105 wm->font()->PutString(screen, ivec2::zero, symbol_str(key), 106 106 color_table->Lookup(u8vec3(g >> 3, g >> 3, g >> 3))); 107 107 } -
abuse/branches/lol/src/imlib/filesel.cpp
r716 r719 141 141 widgets << new AButton(ivec2(100, wh3), cancel_id, cancel_name); 142 142 widgets << new AFilePicker(ivec2(15, wh3 + wm->font()->Size().y + 10), filename_id, 8); 143 return wm->CreateWindow(ivec2 (0), ivec2(-1), FILENAME_str, widgets);143 return wm->CreateWindow(ivec2::zero, ivec2(-1), FILENAME_str, widgets); 144 144 } 145 145 -
abuse/branches/lol/src/imlib/filter.cpp
r709 r719 39 39 40 40 // Make sure non-blacks don't get remapped to the transparency 41 if (color != u8vec3 (0) && to->GetColor(n) == u8vec3(0))41 if (color != u8vec3::zero && to->GetColor(n) == u8vec3::zero) 42 42 n = dk; 43 43 … … 72 72 void Filter::PutImage(AImage *screen, AImage *im, ivec2 pos) 73 73 { 74 ivec2 aa = ivec2 (0), bb = im->Size(), caa, cbb;74 ivec2 aa = ivec2::zero, bb = im->Size(), caa, cbb; 75 75 screen->GetClip(caa, cbb); 76 76 … … 79 79 return; 80 80 81 aa += lol::max(caa - pos, ivec2 (0));81 aa += lol::max(caa - pos, ivec2::zero); 82 82 pos = lol::max(pos, caa); 83 83 bb = lol::min(bb, cbb - pos + aa); -
abuse/branches/lol/src/imlib/fonts.cpp
r715 r719 45 45 { 46 46 tmp.clear(); 47 tmp.PutPart(letters, ivec2 (0),47 tmp.PutPart(letters, ivec2::zero, 48 48 ivec2(ch % 32, ch / 32) * m_size, 49 49 ivec2(ch % 32 + 1, ch / 32 + 1) * m_size, 1); -
abuse/branches/lol/src/imlib/image.cpp
r711 r719 24 24 image_descriptor::image_descriptor(ivec2 size, int keep_dirties) 25 25 { 26 m_aa = ivec2 (0);26 m_aa = ivec2::zero; 27 27 m_bb = size; 28 28 m_size = size; … … 115 115 for(int j = 0; j < m_size.y; j++) 116 116 memset(scan_line(j), color, m_size.x); 117 AddDirty(ivec2 (0), m_size);117 AddDirty(ivec2::zero, m_size); 118 118 } 119 119 … … 198 198 void AImage::PutImage(AImage *im, ivec2 pos, int transparent) 199 199 { 200 PutPart(im, pos, ivec2 (0), im->m_size, transparent);200 PutPart(im, pos, ivec2::zero, im->m_size, transparent); 201 201 } 202 202 … … 210 210 // see if the are to be put is outside of actual image, if so adjust 211 211 // to fit in the image 212 pos += lol::min(aa, ivec2 (0));213 aa += lol::min(aa, ivec2 (0));212 pos += lol::min(aa, ivec2::zero); 213 aa += lol::min(aa, ivec2::zero); 214 214 bb = lol::min(bb, im->m_size); 215 215 // return if it was adjusted so that nothing will be put … … 221 221 return; 222 222 223 aa += lol::max(caa - pos, ivec2 (0));224 pos += lol::max(caa - pos, ivec2 (0));223 aa += lol::max(caa - pos, ivec2::zero); 224 pos += lol::max(caa - pos, ivec2::zero); 225 225 bb = lol::min(bb, cbb - pos + aa); 226 226 if (!(aa < bb)) … … 272 272 else 273 273 { 274 aa = ivec2 (0);274 aa = ivec2::zero; 275 275 bb = m_size; 276 276 } … … 348 348 return; 349 349 350 aa = lol::max(aa, ivec2 (0));350 aa = lol::max(aa, ivec2::zero); 351 351 bb = lol::min(bb, m_size); 352 352 … … 441 441 return; 442 442 443 aa = lol::max(aa, ivec2 (0));443 aa = lol::max(aa, ivec2::zero); 444 444 bb = lol::min(bb, m_size); 445 445 -
abuse/branches/lol/src/imlib/palette.cpp
r708 r719 146 146 void Palette::defaults() 147 147 { 148 m_colors[0] = u8vec3 (0);148 m_colors[0] = u8vec3::zero; 149 149 m_used[0] = 1; 150 150 -
abuse/branches/lol/src/imlib/sprite.cpp
r711 r719 32 32 m_save = new AImage(visual->Size()); 33 33 34 if (m_pos + visual->Size() >= ivec2 (0)&& m_pos < ivec2(xres, yres))35 m_save->PutPart(m_screen, ivec2 (0), m_pos, m_pos + m_save->Size());34 if (m_pos + visual->Size() >= ivec2::zero && m_pos < ivec2(xres, yres)) 35 m_save->PutPart(m_screen, ivec2::zero, m_pos, m_pos + m_save->Size()); 36 36 } 37 37 … … 52 52 } 53 53 54 if (m_pos + visual->Size() >= ivec2 (0)&& m_pos < ivec2(xres, yres))55 m_save->PutPart(m_screen, ivec2 (0), m_pos, m_pos + m_save->Size());54 if (m_pos + visual->Size() >= ivec2::zero && m_pos < ivec2(xres, yres)) 55 m_save->PutPart(m_screen, ivec2::zero, m_pos, m_pos + m_save->Size()); 56 56 } 57 57 -
abuse/branches/lol/src/imlib/transimage.cpp
r709 r719 102 102 memset(im->scan_line(0), 0, m_size.x * m_size.y); 103 103 104 PutImage(im, ivec2 (0));104 PutImage(im, ivec2::zero); 105 105 return im; 106 106 } … … 265 265 void TransImage::PutImage(AImage *screen, ivec2 pos) 266 266 { 267 PutImageGeneric<NORMAL>(screen, pos, 0, NULL, ivec2 (0), NULL, NULL,267 PutImageGeneric<NORMAL>(screen, pos, 0, NULL, ivec2::zero, NULL, NULL, 268 268 0, 1, NULL, NULL, NULL); 269 269 } … … 271 271 void TransImage::PutRemap(AImage *screen, ivec2 pos, uint8_t *map) 272 272 { 273 PutImageGeneric<REMAP>(screen, pos, 0, NULL, ivec2 (0), map, NULL,273 PutImageGeneric<REMAP>(screen, pos, 0, NULL, ivec2::zero, map, NULL, 274 274 0, 1, NULL, NULL, NULL); 275 275 } … … 278 278 uint8_t *map, uint8_t *map2) 279 279 { 280 PutImageGeneric<REMAP2>(screen, pos, 0, NULL, ivec2 (0), map, map2,280 PutImageGeneric<REMAP2>(screen, pos, 0, NULL, ivec2::zero, map, map2, 281 281 0, 1, NULL, NULL, NULL); 282 282 } … … 286 286 ColorFilter *f, Palette *pal) 287 287 { 288 PutImageGeneric<FADE>(screen, pos, 0, NULL, ivec2 (0), NULL, NULL,288 PutImageGeneric<FADE>(screen, pos, 0, NULL, ivec2::zero, NULL, NULL, 289 289 amount, nframes, NULL, f, pal); 290 290 } … … 293 293 uint8_t *tint, ColorFilter *f, Palette *pal) 294 294 { 295 PutImageGeneric<FADE_TINT>(screen, pos, 0, NULL, ivec2 (0), NULL, NULL,295 PutImageGeneric<FADE_TINT>(screen, pos, 0, NULL, ivec2::zero, NULL, NULL, 296 296 amount, nframes, tint, f, pal); 297 297 } … … 299 299 void TransImage::PutColor(AImage *screen, ivec2 pos, uint8_t color) 300 300 { 301 PutImageGeneric<COLOR>(screen, pos, color, NULL, ivec2 (0), NULL, NULL,301 PutImageGeneric<COLOR>(screen, pos, color, NULL, ivec2::zero, NULL, NULL, 302 302 0, 1, NULL, NULL, NULL); 303 303 } … … 314 314 void TransImage::PutFilled(AImage *screen, ivec2 pos, uint8_t color) 315 315 { 316 PutImageGeneric<FILLED>(screen, pos, color, NULL, ivec2 (0), NULL, NULL,316 PutImageGeneric<FILLED>(screen, pos, color, NULL, ivec2::zero, NULL, NULL, 317 317 0, 1, NULL, NULL, NULL); 318 318 } … … 320 320 void TransImage::PutPredator(AImage *screen, ivec2 pos) 321 321 { 322 PutImageGeneric<PREDATOR>(screen, pos, 0, NULL, ivec2 (0), NULL, NULL,322 PutImageGeneric<PREDATOR>(screen, pos, 0, NULL, ivec2::zero, NULL, NULL, 323 323 0, 1, NULL, NULL, NULL); 324 324 } … … 326 326 void TransImage::PutScanLine(AImage *screen, ivec2 pos, int line) 327 327 { 328 PutImageGeneric<SCANLINE>(screen, pos, 0, NULL, ivec2 (0), NULL, NULL,328 PutImageGeneric<SCANLINE>(screen, pos, 0, NULL, ivec2::zero, NULL, NULL, 329 329 line, 1, NULL, NULL, NULL); 330 330 } -
abuse/branches/lol/src/imlib/window.cpp
r716 r719 101 101 { 102 102 j->show(); 103 j->m_surf->AddDirty(ivec2 (0), j->m_size);103 j->m_surf->AddDirty(ivec2::zero, j->m_size); 104 104 } 105 105 } … … 180 180 for (p=m_first; p!=j; p=p->next) 181 181 p->m_surf->AddDirty(j->x-p->x,j->y-p->y,j->x+j->l-p->x,j->y+j->h-p->y); */ 182 j->m_surf->AddDirty(ivec2 (0), j->m_size);182 j->m_surf->AddDirty(ivec2::zero, j->m_size); 183 183 flush_screen(); 184 184 } … … 240 240 j->m_pos.x = x; 241 241 j->m_pos.y = y; 242 j->m_surf->AddDirty(ivec2 (0), j->m_size);242 j->m_surf->AddDirty(ivec2::zero, j->m_size); 243 243 } 244 244 … … 250 250 m_surf = screen; 251 251 hi = Hi; low = Low; med = Med; m_first = NULL; m_pal = pal; m_grab = NULL; 252 bk = pal->FindClosest(u8vec3 (0));252 bk = pal->FindClosest(u8vec3::zero); 253 253 state = inputing; fnt = Font; wframe_fnt = Font; 254 254 memset(key_state, 0, sizeof(key_state)); … … 383 383 AWindow::AWindow(ivec2 pos, ivec2 size, String const &name, AWidgetList const &widgets) 384 384 { 385 m_size = ivec2 (0);385 m_size = ivec2::zero; 386 386 _hidden = false; 387 387 _moveable = true; -
abuse/branches/lol/src/light.cpp
r709 r719 253 253 for (int intensity = 63; intensity >= 0; intensity--) 254 254 { 255 if (rgb != u8vec3 (0))255 if (rgb != u8vec3::zero) 256 256 white_light[intensity*256+color] = pal->FindClosest(rgb); 257 257 else … … 501 501 LightPatch *MakePatchList(ivec2 size, ivec2 screen) 502 502 { 503 LightPatch *first = new LightPatch(ivec2 (0), size - ivec2(1), nullptr);503 LightPatch *first = new LightPatch(ivec2::zero, size - ivec2(1), nullptr); 504 504 505 505 // determine which lights will have effect 506 506 for (LightSource *f = first_light_source; f; f = f->m_next) 507 507 { 508 ivec2 p1 = lol::max(f->m_p1 - screen, ivec2 (0));508 ivec2 p1 = lol::max(f->m_p1 - screen, ivec2::zero); 509 509 ivec2 p2 = lol::min(f->m_p2 - screen, size - ivec2(1)); 510 510 -
abuse/branches/lol/src/loadgame.cpp
r715 r719 201 201 thumbnails[start_num] = new AImage(ivec2(160, 100)); 202 202 thumbnails[start_num]->clear(); 203 console_font->PutString(thumbnails[start_num], ivec2 (0), symbol_str("no_saved"));203 console_font->PutString(thumbnails[start_num], ivec2::zero, symbol_str("no_saved")); 204 204 total_saved++; 205 205 if (!first) first=thumbnails[start_num]; -
abuse/branches/lol/src/menu.cpp
r715 r719 76 76 main_screen->Line(ivec2(bb.x - 1, aa.y + 1), bb - ivec2(1), dr); 77 77 main_screen->Line(ivec2(aa.x + 1, bb.y - 1), bb - ivec2(1), dr); 78 TintArea(aa + ivec2(1), bb, u8vec3 (0), amount);78 TintArea(aa + ivec2(1), bb, u8vec3::zero, amount); 79 79 } 80 80 … … 612 612 inm->clear_current(); 613 613 614 main_screen->AddDirty(ivec2 (0), ivec2(320, 200));614 main_screen->AddDirty(ivec2::zero, ivec2(320, 200)); 615 615 616 616 Event ev; -
abuse/branches/lol/src/sdlport/hmi.cpp
r616 r719 300 300 301 301 // Write Midi file header 302 uint8_t midi_header[] = { 0x4D, 0x54, 0x68, 0x64, 0x00, 0x00, 0x00, 0x06, 0x00, 0x01, 0x00, ( num_tracks + 1), 0x00, 0xC0 };302 uint8_t midi_header[] = { 0x4D, 0x54, 0x68, 0x64, 0x00, 0x00, 0x00, 0x06, 0x00, 0x01, 0x00, (uint8_t)(num_tracks + 1), 0x00, 0xC0 }; 303 303 memcpy(output_buffer_ptr, midi_header, 14); 304 304 output_buffer_ptr += 14; -
abuse/branches/lol/src/transp.cpp
r709 r719 25 25 ivec2 pos(x, y); 26 26 27 aa += lol::max(caa - pos, ivec2 (0));28 bb -= lol::max(caa - pos, ivec2 (0));27 aa += lol::max(caa - pos, ivec2::zero); 28 bb -= lol::max(caa - pos, ivec2::zero); 29 29 pos = lol::max(caa, pos); 30 30 31 31 bb = lol::min(bb, cbb - ivec2(1) - pos); 32 32 33 if (!(bb >= ivec2 (0)))33 if (!(bb >= ivec2::zero)) 34 34 return; 35 35 screen->AddDirty(pos, pos + bb); -
abuse/branches/lol/src/view.cpp
r716 r719 196 196 no_ytop=0; 197 197 no_ybottom=0; 198 m_lastlastpos = m_lastpos = focus ? focus->m_pos : ivec2 (0);198 m_lastlastpos = m_lastpos = focus ? focus->m_pos : ivec2::zero; 199 199 last_hp=last_ammo=-1; 200 200 last_type=-1; … … 215 215 216 216 player_number=number; 217 m_aa = ivec2 (0);217 m_aa = ivec2::zero; 218 218 m_bb = ivec2(100); 219 219 m_focus = focus;
Note: See TracChangeset
for help on using the changeset viewer.